Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (BOOL)verifyDelegate:(id <MyOperationDelegate>)delegate
- {
- BOOL isGood = YES;
- __delegateHasFailedWithErrorMethod = [delegate respondsToSelector:@selector(operation:failedWithError:)];
- __delegateHasLoadedImageMethod = [delegate respondsToSelector:@selector(operation:loadedImage:)];
- isGood = __delegateHasFailedWithErrorMethod && __delegateHasLoadedImageMethod;
- if (!isGood)
- {
- NSLog(@"Delegate for MyOperation does not fully implement all methods");
- if (__delegateHasFailedWithErrorMethod == NO)
- NSLog(@"Delegate for MyOperation does not respond to SEL(operation:failedWithError:)");
- if (__delegateHasFailedWithErrorMethod == NO)
- NSLog(@"Delegate for MyOperation does not respond to SEL(operation:loadedImage:)");
- }
- return isGood;
- }
Add Comment
Please, Sign In to add comment