alibaba / wax

Wax is a framework that lets you write native iPhone apps in Lua.
http://github.com/probablycorey/wax
MIT License
1.84k stars 280 forks source link

How to call lua function from objc #29

Open thienhaole92 opened 8 years ago

thienhaole92 commented 8 years ago

I wrote the code blow but when I run this code message 'MoboSDK_Login is not loaded' is printed. Please help me resolve this issue.

lua_getglobal(wax_currentLuaState(), "DisplayEnterPhoneControllerWithChannel"); if (lua_type(wax_currentLuaState(), -1) != LUA_TTABLE) { NSLog(@"MoboSDK_Login is not loaded"); } lua_pushstring(wax_currentLuaState(), "This is channel :)"); if (lua_pcall(wax_currentLuaState(), 1, 0, 0)) { NSLog(@"Lua Error: %s\n", lua_tostring(wax_currentLuaState(), -1)); }

intheway commented 8 years ago

like this http://www.cnblogs.com/sifenkesi/p/3873720.html