Executing JavaScript in Objective-C

Hi all,

I was able to call objective -c method from javascript but I am not able to call the javascript code in Objective C.

I tried the code written in documentation

but it throws error stating that the ScriptEngine is not found in se namespace

Does anyone know how to rectify this?

PS: cocos creator ver 3.3.2

Add this header file
#include “cocos/bindings/jswrapper/SeApi.h”

HI @muxiandong Thanks for the solution.

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