Created
April 7, 2010 14:27
-
-
Save jdewind/358943 to your computer and use it in GitHub Desktop.
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
@implementation MyObject | |
-(void)showOneConfirmationAlert:(NSMutableDictionary *)externalState { | |
externalStateForOneConfirmationAlert = [externalState retain]; | |
oneConfirmationAlert = [[ConfirmationAlert show:@"Are you sure about this?" delegate:self] retain]; | |
} | |
-(void)showAnotherConfirmationAlert:(NSMutableDictionary *)externalState { | |
externalStateForAnotherConfirmationAlert = [externalState retain]; | |
oneConfirmationAlert = [[ConfirmationAlert show:@"Again, are you sure?" delegate:self] retain]; | |
} | |
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex { | |
if (alertView.cancelButtonIndex == buttonIndex) { | |
if(alertView == oneConfirmationAlert) { | |
//... | |
NSLog([externalStateForOneConfirmationAlert objectForKey:@"Key"]); | |
} else { | |
//... | |
NSLog([externalStateForOneConfirmationAlert objectForKey:@"DifferentKey"]); | |
} | |
} else { | |
if(alertView == anotherConfirmationAlert) { | |
//... | |
NSLog([externalStateForAnotherConfirmationAlert objectForKey:@"AnotherKey"]); | |
} else { | |
//... | |
NSLog([externalStateForAnotherConfirmationAlert objectForKey:@"YetAnotherKey"]); | |
} | |
} | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment