cocos / cocos-docs

Manual docs content for Cocos Creator
https://docs.cocos.com
307 stars 461 forks source link

Objective-C 原生反射机制 #1697

Closed LincolnLiuXinbing closed 1 year ago

LincolnLiuXinbing commented 3 years ago

URL : https://github.com/cocos-creator/creator-docs/blob/master/zh/advanced-topics/oc-reflection.md#objective-c-%E6%89%A7%E8%A1%8C-javascript-%E4%BB%A3%E7%A0%81

代码示例部分建议加上需要导入的头文件:

#import “cocos/platform/CCApplication.h”
#import “cocos/base/CCScheduler.h”
#import “cocos/scripting/js-bindings/jswrapper/SeApi.h”

...

Application::getInstance()->getScheduler()->performFunctionInCocosThread([=](){
    se::ScriptEngine::getInstance()->evalString(script.c_str());
});
xunyi0 commented 3 years ago

收!感谢反馈

MrKylinGithub commented 1 year ago

你好,相关文档已更新,请查收。 谢谢反馈。