-
Notifications
You must be signed in to change notification settings - Fork 2
/
luaoc.lua
28 lines (24 loc) · 879 Bytes
/
luaoc.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
local luaoc = {}
local callStaticMethod = LuaObjcBridge.callStaticMethod
function luaoc.callStaticMethod(className, methodName, args)
local ok, ret = callStaticMethod(className, methodName, args)
if not ok then
local msg = string.format("luaoc.callStaticMethod(\"%s\", \"%s\", \"%s\") - error: [%s] ",
className, methodName, tostring(args), tostring(ret))
if ret == -1 then
print(msg .. "INVALID PARAMETERS")
elseif ret == -2 then
print(msg .. "CLASS NOT FOUND")
elseif ret == -3 then
print(msg .. "METHOD NOT FOUND")
elseif ret == -4 then
print(msg .. "EXCEPTION OCCURRED")
elseif ret == -5 then
print(msg .. "INVALID METHOD SIGNATURE")
else
print(msg .. "UNKNOWN")
end
end
return ok, ret
end
return luaoc