I have this in my class header:
typedef void(^DBSuccessBlock)();
typedef void(^DBErrorBlock)(int errorNumber, NSString* description);
- (void) connect:(NSString*) path isFile:(BOOL) flag
success:(DBSuccessBlock) success
error:(DBErrorBlock) error;
This is how I'm trying to call the method:
[db connect:filePathName isFile:YES success:^{
// initialize db here if necessary
} error:^(int errorNumber, NSString *description) { //error on this line
NSLog(description);
return nil;
}];
The error line is giving me this compile error: Incompatible block pointer types sending 'void *(^)(int, NSString *_strong)' to parameter of type 'DBErrorBlock' (aka 'void (^)(int, NSString *_strong)')
The only difference I see is void* vs void and I'm not sure why. Can anyone help me figure out why I'm getting this error? Thanks.