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
https://docs.cocos.com/creator/3.3/manual/en/advanced-topics/oc-reflection.html#executing-javascript-in-objective-c

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.