Quantcast
Channel: Cocos中文社区 - 最新主题
Viewing all articles
Browse latest Browse all 88738

JSB: how to properly call javascript function from objective c code?

$
0
0

@jackiszhp 写道:

with iOS, How to properly call javascript function from objective c?

I know eventually, we call this:
NSString *jscode="console.log('something');";
BOOL tf= se::ScriptEngine::getInstance()->evalString([jscode UTF8String]);

but I am wondering whether we need the following? as this is not documented in official documents:

cocos2d::Director::getInstance()->getScheduler()->performFunctionInCocosThread(sendMsgToCocosJs);

anyone has any idea? thanks.

帖子: 1

参与者: 1

阅读整个主题


Viewing all articles
Browse latest Browse all 88738

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>