Created
October 12, 2013 14:50
-
-
Save kmdsbng/6950779 to your computer and use it in GitHub Desktop.
alertView表示&コールバック
This file contains hidden or 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)showAlert:(UIButton *)sender { | |
| UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"タイトル" | |
| message:@"本文" | |
| delegate:self | |
| cancelButtonTitle:@"キャンセル" | |
| otherButtonTitles:@"OK", nil]; | |
| [alertView show]; | |
| NSLog(@"%@", @"アラート押された"); | |
| } | |
| - (void)alertView:(UIAlertView *)alertView | |
| clickedButtonAtIndex:(NSInteger)buttonIndex | |
| { | |
| NSLog(@"%@", @"閉じた"); | |
| if(buttonIndex == 0) { | |
| NSLog(@"%@", @"キャンセル"); | |
| } else if(buttonIndex == 1){ | |
| NSLog(@"%@", @"OK"); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment