When designing a block-based API in ObjC, which approach is better, one completion block or two, one each for success and failure?
Let's say we have a method retrieving something asynchronously to a block, with one completion block it would be:
- (void) retrieveSomethingCompletion:(void (^)(id retrievedObject, NSError *error))completionBlock;
And with success/failure blocks (AFNetworking style):
- (void) retrieveSomethingSuccess:(void(^)(id retrievedObject))successBlock failure:(void(^)(NSError *error))failureBlock;
I always use the second approach, but what are the pro/cons of each option? What do you use normally and why?