Reputation: 21563
I have a block;
typedef void (^SIResponseHandler) (id obj, NSString *error);
and a method:
+ (void)uploadPhoto:(UIImage *)photo
toPathForComponents:(NSArray *)components
completionHandler:(SIResponseHandler)responseHandler;
and another method which calls the above method:
+ (void)updateProfilePhoto:(UIImage *)photo handler:(SIResponseHandler *)handler {
NSArray *components = @[@"users", sharedInstance.username, @"profile", @"photo", @"upload"];
[SIRequest uploadPhoto:photo
toPathForComponents:components
progressHandler:nil
completionHandler:handler];
}
In the last line, I get this error:
Sending '__autoreleasing SIResponseHandler *' (aka 'void (^__autoreleasing *)(__strong id, NSString *__strong)') to parameter of incompatible type 'SIResponseHandler' (aka 'void (^)(__strong id, NSString *__strong)')
I have no idea what this means. Can someone please explain what's going on ? Thanks
Upvotes: 1
Views: 1840
Reputation: 55573
It appears that SIResponseHandler
is a block type, and as such should not be suffixed as a pointer with *
in an argument list, unless you know exactly what you are doing.
Upvotes: 5