1.OC 调用JS方法:
在.mm 中
#include "cocos/scripting/js-bindings/jswrapper/SeApi.h"
std::stringjsCallStr =cocos2d::StringUtils::format("cc.SdkManager.onLoginResp(\"%s\",\"%s\");", sdk_sessionid.UTF8String,sdk_userid.UTF8String);
se::Value*ret =newse::Value();
se::ScriptEngine::getInstance()->evalString(jsCallStr.c_str() , -1, ret);
2. JS 调用OC方法
jsb.reflection.callStaticMethod("AppController", "payBtn:orderID:", num, orderID);
3.cc.game
cc.game.setFrameRate(30); 设置游戏帧率。