Skip to content

Instantly share code, notes, and snippets.

@jdewind
Created April 7, 2010 14:27
Show Gist options
  • Save jdewind/358943 to your computer and use it in GitHub Desktop.
Save jdewind/358943 to your computer and use it in GitHub Desktop.
@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