Skip to content
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

I can't initialize NSDictionary or NSMutableDictionary in lua #57

Closed
softwind0214 opened this issue Aug 8, 2014 · 1 comment
Closed

Comments

@softwind0214
Copy link

I'm writing a method in lua, which should return a dictionary. Firstly, I try to use NSDictionray:dictionaryWithObjectsAndKeys(), but it didn't work. Later, I try NSMutableDictionary:init() or NSDictionary:init():mutableCopy(), but it crashed here:

    if (returnedInstanceUserdata) { // Could return nil
        [returnedInstanceUserdata->instance release]; // Wax automatically retains a copy of the object, so the alloc needs to be released
    }

Is there any way to create and return a dictionary in lua?

@intheway
Copy link

you should just use lua table. like local dict = {k1="v1", k2="v2"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants