Last active
April 6, 2016 17:23
-
-
Save dodikk/1b03aba5ece9a4f0e208d1cb981cbe83 to your computer and use it in GitHub Desktop.
NSError polymorphism approach example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <NSError+UserFriendly.h> | |
-(void)onMyNewsLoadingCompleted:(id)maybeResult | |
error:(NSError*)maybeError | |
{ | |
[error presentAlertToTheUser]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface NSError( UserFriendly) | |
-(void)presentAlertToTheUser; | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface XYLoadMyNewsError(UserFriendly) | |
-(void)presentAlertToTheUser; | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface XYLoadMyNewsError : NSError | |
@end |
Author
dodikk
commented
Apr 6, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment