Skip to content

Instantly share code, notes, and snippets.

@bouchtaoui-dev
Created January 12, 2016 13:52
Show Gist options
  • Save bouchtaoui-dev/08cb581b18743c3ae2ca to your computer and use it in GitHub Desktop.
Save bouchtaoui-dev/08cb581b18743c3ae2ca to your computer and use it in GitHub Desktop.
- (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