creator 1.5.2的。 Xcode是8.3.3
第二个你想要返回值的写法的问题,你试试这么写看看
ScriptingCore* sc = ScriptingCore::getInstance();
JSContext* cx = sc->getGlobalContext();
JS::RootedValue outVal(cx);
//jsval outVal;
bool flag=sc->evalString(“cc.find(‘Game’).getComponent(‘Player’).onBeforeWillEnterForeground();”, &outVal);
NSLog(@“call bool:%d”,flag);
jsval_to_int(cx,outVal,&val);
NSLog(@“iOS paused:%d”,val);