Created
April 22, 2012 09:41
-
-
Save advantis/2463098 to your computer and use it in GitHub Desktop.
Shortcut method for quick NSError presentation
This file contains 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
// | |
// Copyright © 2010 Yuri Kotov | |
// | |
#import <Foundation/Foundation.h> | |
@interface NSError (ADVAlertPresentation) | |
- (void) displayInAlert; | |
@end |
This file contains 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
// | |
// Copyright © 2010 Yuri Kotov | |
// | |
#import "NSError+ADVAlertPresentation.h" | |
#import <UIKit/UIKit.h> | |
@implementation NSError (ADVAlertPresentation) | |
- (void) displayInAlert | |
{ | |
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Error", nil) | |
message:[self localizedDescription] | |
delegate:nil | |
cancelButtonTitle:NSLocalizedString(@"OK", nil) | |
otherButtonTitles:nil]; | |
[alert show]; | |
#if !__has_feature(objc_arc) | |
[alert release]; | |
#endif | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment