I am playing with the most recent version of JSCocoa. And I noticed that I can't use custom inline C function (previously loading the BridgeSupport file), but for example, CGPointMake works OK.
> I am playing with the most recent version of JSCocoa.
> And I noticed that I can't use custom inline C function (previously loading the BridgeSupport file), but for example, CGPointMake works OK.
Inline functions are compiled every time they're used, so they don't exist as something that can be called.
BridgeSupport can handle inline functions like CGPointMake because they're defined in an external library. (CoreGraphics.framework/Versions/A/Resources/BridgeSupport/CoreGraphics.dyl ib)
Certain elements, such as inline functions, cannot be described in the metadata files. It is therefore
required to generate a dynamic library in order to make the bridges use them. The gen_bridge_metadata
tool can take care of that for you.
On Monday, May 14, 2012 6:42:26 PM UTC-7, parmanoir wrote:
> I am playing with the most recent version of JSCocoa. > And I noticed that I can't use custom inline C function (previously > loading the BridgeSupport file), but for example, CGPointMake works OK.
> Inline functions are compiled every time they're used, so they don't exist > as something that can be called.
> BridgeSupport can handle inline functions like CGPointMake because they're > defined in an external library.
> Certain elements, such as inline functions, cannot be described in the metadata files. It is therefore > required to generate a dynamic library in order to make the bridges use them. The gen_bridge_metadata > tool can take care of that for you.
So, I created a dylib with gen_bridge_metada -F dylib, and now all the inline functions are in the dylib (I verified this with the 'nm' command line tool).
My question is: how can I use this dylib inside my project ? I added it in the "copy resources", also in the "link binary with libraries", but when I load the app it fails with this error:
*dyld: Library not loaded: ../Resources-Mac/cocos2d-mac.dylib*
*Reason: image not found* * * Should I call dyld manually ?* *
Do you know where should I put the .dylib file ? If possible, I would like to avoid changing the LD_LIBRARY_PATH environment.* *
On Monday, May 14, 2012 9:24:59 PM UTC-7, Ricardo Quesada wrote:
> Thanks. It makes sense.
> On Monday, May 14, 2012 6:42:26 PM UTC-7, parmanoir wrote:
>> I am playing with the most recent version of JSCocoa. >> And I noticed that I can't use custom inline C function (previously >> loading the BridgeSupport file), but for example, CGPointMake works OK.
>> Inline functions are compiled every time they're used, so they don't >> exist as something that can be called.
>> BridgeSupport can handle inline functions like CGPointMake because >> they're defined in an external library.
>> Certain elements, such as inline functions, cannot be described in the metadata files. It is therefore >> required to generate a dynamic library in order to make the bridges use them. The gen_bridge_metadata >> tool can take care of that for you.
*2012-05-15 17:34:53.908 JavascriptTest[24154:503] JSException: Return value not converted in ccc4f on line 369 of /Users/rquesada/Library/Developer/Xcode/DerivedData/cocos2d-mac-elbpvrbdkhi jembzvwboldykqqaq/Build/Products/Debug/JavascriptTest.app/Contents/Resource s/js/test-action.js * * * ccc4 is defined like this:* *
> 2012-05-15 17:34:53.908 JavascriptTest[24154:503] toJSValueRef FAILED
> 2012-05-15 17:34:53.908 JavascriptTest[24154:503] JSException: Return value not converted in ccc4f on line 369 of /Users/rquesada/Library/Developer/Xcode/DerivedData/cocos2d-mac-elbpvrbdkhi jembzvwboldykqqaq/Build/Products/Debug/JavascriptTest.app/Contents/Resource s/js/test-action.js
> 2012-05-15 17:34:53.908 JavascriptTest[24154:503] JSException: Return value
> not converted in ccc4f on line 369 of
> /Users/rquesada/Library/Developer/Xcode/DerivedData/cocos2d-mac-elbpvrbdkhi jembzvwboldykqqaq/Build/Products/Debug/JavascriptTest.app/Contents/Resource s/js/test-action.js