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

block 作为参数JS如何定义? #68

Closed
sanshanchuns opened this issue Jul 29, 2015 · 2 comments
Closed

block 作为参数JS如何定义? #68

sanshanchuns opened this issue Jul 29, 2015 · 2 comments

Comments

@sanshanchuns
Copy link

OC:
typedef void (^WVJBResponseCallback)(id responseData);

[_bridge registerHandler:@"logOut" handler:^(id data, WVJBResponseCallback responseCallback) {
[[LoginManager sharedInstance] logout];
responseCallback(@{@"status":@"1", @"respData":@{@"test":@"test"}});
}];

JS:
self.bridge().registerHandler_handler("logOut", block("id, WVJBResponseCallback", function(data, responseCallback){
console.log("回调成功")
}))

以上这样写回调不成功....

@bang590
Copy link
Owner

bang590 commented Jul 29, 2015

不清楚是哪个回调不成功,不过 block("id, WVJBResponseCallback, )" 得写成 block("id, NSBlock*", )

@sanshanchuns
Copy link
Author

谢谢, 这样可以了. 也就是说 block 作为参数 得用 NSBlock* 谢谢 bang..

@bang590 bang590 closed this as completed Jul 31, 2015
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

2 participants