不兼容的块指针类型'void(^)()NSUInteger *(*)(int))'到'void(^)(int)'

时间:2013-12-13 09:07:18

标签: objective-c pointers

我试图将一个数字(0,1,2,3或4)作为回调发送到MasterViewController.h中的函数,并使用int从Snapchat.h发送该数据

以下是我的MasterViewController.m中的代码

[[Snapchat sharedClient] initiateLoginWithUsername:@"USERNAME" password:@"PASSWORD" callback:^(NSUInteger *response(int)){
    //NSLog(@"Stage 1: %@", response);
}];

......这是Snapchat.h的代码

-(void)initiateLoginWithUsername:(NSString *)username password:(NSString *)password callback:(void (^)(int))callback;

但是当我构建并运行时,我在为MasterViewController.m提供的代码上收到错误Incompatible block pointer types sending 'void (^)()NSUInteger *(*)(int))' to parameter of type 'void(^)(int)'

谢谢大家!

1 个答案:

答案 0 :(得分:2)

将此^(NSUInteger *response(int)语句替换为^(int response)