cocos OC调用JS

#import "ScriptingCore.h"
std::string arg ="test";
std::string funName ="UtilsPlatform.alertEmailSetting";
std::string rStr = funName + "(\"" + arg + "\");";
ScriptingCore::getInstance()->evalString(rStr.c_str());

ccc1.8版本开始要改为:
#import "cocos/scripting/js-bindings/jswrapper/SeApi.h"
se::ScriptEngine::getInstance()->evalString(rStr.c_str());

  

posted @ 2018-08-28 10:15  随风的博客  阅读(1050)  评论(0编辑  收藏  举报