My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
JSCocoaInternals  
Updated Feb 4, 2010 by parman...@gmail.com
  • JSCocoaPrivateObject is the boxing class for ObjC data. When calling an ObjC method returning NSString, that NSString will be stored in our custom Javascript object containing an instance of JSCocoaPrivateObject, itself owning (retaining) the NSString. It's held as internal data by Javascript objects.
  • JSCocoaFFIArgument handles boxing/unboxing between ObjC and Javascript data. It converts arguments from Javascript to ObjC and return values from ObjC to Javascript. It gets its name from libffi, as the converted arguments are passed to ffi_call.
  • JSCocoaFFIClosure creates at runtime a C function with a specific set of arguments and return value, called a MethodEncoding. When adding Javascript functions as class methods, JSCocoaController creates a JSCocoaFFIClosure and adds it to the class via ObjCRuntime and its function class_addMethod.

SampleBridgeEvaluation shows how all these interact.


Sign in to add a comment
Powered by Google Project Hosting