-
Notifications
You must be signed in to change notification settings - Fork 630
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
Support for Objective-C blocks #43
Comments
agree,should support for blocks |
I was just wondering how to invoke the 'NSGlobalBlock' if I make it through from Objc to Lua as a parameter. Help! |
I'm not actively maintaining Wax anymore, so I'm not sure if that is possible. But I have a hunch that it is. |
void *wax_copyToObjc(lua_State *L, const char *typeDescription, int stackIndex, int *outsize) //immobSDK.m _older__no use__see above*_*************************** typedef void(^completionHandler)(id); //only used for this kind of NSGlobalBlock int wax_call(id aObserver, SEL aSelector, const char *aName,id aObject, completionHandler handler){
} And the Lua code should post the notification to return. e.g. [immobSDK getScore:@"123456" :^(id score) { @interface immobSDK : NSObject +(void)getScore:(NSString *)adunitID :(void (^)(id score)) handler; @implementation immobSDK +(void)getScore:(NSString *)adunitID :(void (^)(id score)) handler{ immobSDK.lua function immobSDK:Score(adunitID) Better ideas? Thank U I've tried the NSStackBlock,and it cannnot be forced to NSGlobalBlock,otherwise there will be a crash. |
Support for Objective-C blocks would be great...
So we could use methods like animateWithDuration:animations:
Bye!
The text was updated successfully, but these errors were encountered: