sc->addRegisterCallback(register_CCBuilderReader) throws BAD_ACCESS_EXC

I try to develop an app on iOS. I’m using source code from git://github.com/cocos2d/cocos2d-x.git repo and provided XCode template.

To be able to compile the code I had to change manually:

#include “jsb_cocos2dx.hpp” => #include “jsb_cocos2dx_auto.hpp” in AppDelegate.cpp

After that code compiles fine.

Unfortunately app crashes when when this code is executed: sc->addRegisterCallback;
the exception is: Assertion failure: JSVAL_IS_OBJECT_OR_NULL_IMPL), at libs/javascript/spidermonkey-ios/include/jsapi.h:2152

any ideas how to fix that?

jsb_cocos2dx.hpp? do you mean ‘cocos2d.hpp’?

yes :slight_smile: ‘cocos2d.hpp’

are you sure ‘sc~~>addRegisterCallback’ below ’sc~~>addRegisterCallback(register_all_cocos2dx)’?

Yes.
The code is from the default template. I have to comment out that line to have it working.