Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #import "ViewController.h"
- @interface ViewController ()
- @end
- @implementation ViewController
- - (void)viewDidLoad {
- [super viewDidLoad];
- // Do any additional setup after loading the view, typically from a nib.
- UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Title"
- message:@"Message"
- delegate:self
- cancelButtonTitle:@"cancel"
- otherButtonTitles:@"other1",@"other2",nil];
- [alert show];
- }
- - (void)didReceiveMemoryWarning {
- [super didReceiveMemoryWarning];
- // Dispose of any resources that can be recreated.
- }
- -(void)alertView:(UIAlertView*)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
- {
- if (buttonIndex == 1) {
- NSLog(@"1");
- }else if (buttonIndex == 2){
- NSLog(@"2");
- }else if (buttonIndex == 0){
- NSLog(@"0");
- }
- }
- @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement