Created
January 12, 2016 13:52
-
-
Save bouchtaoui-dev/08cb581b18743c3ae2ca 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
- (IBAction)btnExit:(id)sender { | |
UIAlertView *messageBox = [[UIAlertView alloc] initWithTitle:@"Exit" | |
message:@"Are you sure?" | |
delegate:self | |
cancelButtonTitle:@"No" | |
otherButtonTitles:@"Yes", nil]; | |
[messageBox show]; | |
} | |
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex | |
{ | |
NSString *title = [alertView buttonTitleAtIndex:buttonIndex]; | |
if([title isEqualToString:@"No"]) { | |
NSLog(@"No was selected."); | |
} | |
else if([title isEqualToString:@"Yes"]) { | |
NSLog(@"Yes was selected."); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment