Fix for update: bug #1

Merged
merged 1 commit into from Jun 26, 2012

Projects

None yet

3 participants

lrz commented Jun 26, 2012

This fix is required in order for cocos2d to be able to send an update: message to classes defined in RubyMotion. The problem is that cocos2d performs this selector with the assumption that the method accepts a ccTime argument, however, this method is not declared in the header files in a way that the RubyMotion compiler could know at build time that the argument of this method is a ccTime (therefore the crash at runtime).

In order to work around this problem, we simply define this method on an NSObject category. Sadly I don't see a way to fix RubyMotion here.

Make sure to clean up everything + delete the .bridgesupport file before building again.

@lrz lrz define a category for the update(ccTime) method so that the RubyMotio…
…n compiler can properly use the right signature
e6678ff
@scottymac scottymac merged commit 8ec33e5 into scottymac:master Jun 26, 2012

Interesting... I had to do the same for the JS bindings that I am working on...
cocos2d v2.1 has "udpate(ccTime)" defined on CCNode.h

Since I am also using BridgeSupport for cocos2d v2.1, most of these issues are going to be fixed automatically for RubyMotion as well.

(v2.1 branch is here: https://github.com/ricardoquesada/cocos2d-iphone/tree/js-spidermonkey/ )

Owner

Good news -- thanks, Ric.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment