Created
June 17, 2014 17:29
-
-
Save akitsukada/e597feeb40ba3bbe8992 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
@interface MyClass() <UIAlertViewDelegate> | |
@end | |
@implementation MyClass | |
- (void) hoge | |
{ | |
UIAlertView *alert = [[UIAlertView alloc] init]; | |
alert.delegate = self; | |
alert.title = @"タイトル"; | |
alert.message = @"メッセージ"; | |
[alert addButtonWithTitle:@"OK"]; | |
[alert addButtonWithTitle:@"CANCEL"]; | |
alert.cancelButtonIndex = 1; | |
[alert show]; | |
} | |
-(void)alertView:(UIAlertView*)alertView | |
clickedButtonAtIndex:(NSInteger)buttonIndex | |
{ | |
switch (buttonIndex) { | |
case 0: | |
NSLog(@"OK"); | |
break; | |
case 1: | |
NSLog(@"CANCEL"); | |
break; | |
} | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment