我已将架构更改为标准,因为在iTunes中不会接受存档。我有一个模块的问题,代码在这里:
- (UIViewController *)modulePage:(NSString *)pageName params:(NSDictionary *)params {
UIViewController *vc = nil;
if ([pageName isEqualToString:LocalPathPageNameHome]) {
vc = [[AboutTableViewController alloc] initWithNibName:@"AboutTableViewController" bundle:KGO_SHARED_RESOURCE_BUNDLE()];
}
else if ([pageName isEqualToString:LocalPathPageNameDetail]) {
NSString *command = [params objectForKey:@"command"];
if (command) {
KGOWebViewController *webVC = [[KGOWebViewController alloc] init];
webVC.title = [params stringForKey:@"title"];
[webVC applyTemplate:@"common/fullscreenWebview.html"];
KGORequest *request = [[KGORequestManager sharedManager] requestWithDelegate:nil
module:@"about"
path:command
version:1
params:nil];
request.expectedResponseType = [NSString class];
request.handler = ^(id jsonObject) {
webVC.HTMLString = jsonObject;
return 1;
};
[request connect];
vc = webVC;
}
}
return vc;
}
@end
错误是:
从'int(^)(__ strong id)'
分配给'JSONObjectHandler'(又名'NSInteger(^)(__ strong id)')的不兼容块指针类型
任何想法..
答案 0 :(得分:0)
尝试:
request.handler = ^NSInteger(id jsonObject) {
webVC.HTMLString = jsonObject;
return 1;
};
即。匹配提供的块的返回类型。