lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Nobody has a clue? Even a "but it works on my system" reply would be helpful, to give me some hope. Otherwise I'm forced to port my lib to C++, which is not a happy thought.

cheers, -thijs


On 7/4/07, Thijs Koerselman <> wrote:
Hi All,

I'm new to this list and just started on Lua a few months ago. I'm writing a library using Obj-C and I'm trying to use the LuaObjCBridge (on Intel Mac). I have successfully compiled the framework, linked it into my Lua module and loaded the module in the standalone interpreter I'm using. I can create an object from Lua, and call its member functions so all that seems to work fine.

The only problem is, I can't call any functions with more than 1 argument. In such case I get an error: "Receiver does not implement method."

require("luandi") -- my module

button = objc.class("NDIRectangle"):alloc()
button:alive() -- OK
button:testfloat(666.0) -- OK

print(button:x()) -- OK
print(button:width()) --OK

button:testtwoints(34, 34) -- ERROR
button:testfloatfloat(3233.0, 43.0) -- ERROR

The only odd thing I found was that I had to edit the following in LuaObjCBridge.m otherwise "objc" wasn't a valid table in Lua:

int lua_objc_open(lua_State* state){

        // change this line :
        // luaL_register(state,lua_tostring(state,-1),lua_objc_functions);

        // into this line :

    return 0;

Does anybody have a clue? I've tried everything to make sure I wasn't doing something stupid, but I'm really stuck. Is there anything obvious I might be missing? Anyone using LuaObjCBridge on Intel Mac successfully?