"evalString" function is missing (JS function call from Objective C)

"evalString" function is missing (JS function call from Objective C)
0

Hello @slackmoehrle @Big_Bear ,

I want to call JS function of cocos creator (version 1.8.2) from objective C (xcode).
Also tried this [https://stackoverflow.com/questions/27224765/how-to-call-cocos2d-js-method-from-objective-c]

But as mentioned in that link "#include “cocos/scripting/js-bindings/manual/ScriptingCore.h” i include this in my header file but it didn’t recognise “evalString” function in that path.
This function is missing in that class.

Please help me to figure it out how to manage JS function call from Objective C.

Thanks

Hi @slackmoehrle @Big_Bear,

I have the same problem and already tried this link below, but didn’t get any solution.

will you please help.

@slackmoehrle Can you help me out which developer to ask about this problem?

Have you tried this code before?
se::ScriptEngine::getInstance()->evalString(strValue.c_str());

Hi @huanxinyin, Thanks for the reply.
Yes already tried and followed this link :- How to call Javascript function in Java with Cocos2d-JS?

As i want to call my predifined script function which is in my cocos creator project file, not in resource folder of Xcode.
Please help me out with any solution…

If you use this function call,you need include the head file:
#include “cocos/scripting/js-bindings/jswrapper/SeApi.h”

And then do this call should not has a build error.
se::ScriptEngine::getInstance()->evalString(strValue.c_str());

If you encounter other problems,please send me a custom code demo.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Hi @huanxinyin, Thanks a lot. It solved my problem.