You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
903 B

  1. local luaoc = {}
  2. if LuaObjcBridge then
  3. local callStaticMethod = LuaObjcBridge.callStaticMethod
  4. function luaoc.callStaticMethod(className, methodName, args)
  5. local ok, ret = callStaticMethod(className, methodName, args)
  6. if not ok then
  7. local msg = string.format("luaoc.callStaticMethod(\"%s\", \"%s\", \"%s\") - error: [%s] ",
  8. className, methodName, tostring(args), tostring(ret))
  9. if ret == -1 then
  10. print(msg .. "INVALID PARAMETERS")
  11. elseif ret == -2 then
  12. print(msg .. "CLASS NOT FOUND")
  13. elseif ret == -3 then
  14. print(msg .. "METHOD NOT FOUND")
  15. elseif ret == -4 then
  16. print(msg .. "EXCEPTION OCCURRED")
  17. elseif ret == -5 then
  18. print(msg .. "INVALID METHOD SIGNATURE")
  19. else
  20. print(msg .. "UNKNOWN")
  21. end
  22. end
  23. return ok, ret
  24. end
  25. end
  26. return luaoc