-
Notifications
You must be signed in to change notification settings - Fork 761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OC的代码怎么调用lua的某一个函数? #38
Comments
OC不懂,但是你可以参考Java: public int luaFunc(int num) {
LuaValue func = globals.get("luaFunc");
if (!func.isnil()) {
try {
return func.call(CoerceJavaToLua.coerce(num)).toint();
} catch (Exception e) {
e.printStackTrace();
}
} else {
System.out.println("func not found");
}
return 0;
} |
LView.h头文件里面定义的两个API: |
UIView+LuaView.h 里的
window.callback{ 我试了一下 也可以 |
看到demo里面有lua脚本调用oc函数的案例,但是反过来可以在oc代码里面直接调用lua 执行其中某一个函数吗? 没看到相关的代码。
另外demo中代码不完整:
2016-06-26 14:34:54.856 Demo[23080:758361] [LuaView][error] Not found Method: JHSLuaViewController.setLuaBox:
2016-06-26 14:38:07.796 Demo[23080:758361] [LuaView][error] Not found Method: JHSLuaViewController.externalApiDemo:number:
2016-06-26 14:38:07.796 Demo[23080:758361] [LuaView][error] Not found Method: JHSLuaViewController.externalApiDemo
The text was updated successfully, but these errors were encountered: