Advertisement
Guest User

Untitled

a guest
May 28th, 2015
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. #import "ViewController.h"
  2.  
  3. @interface ViewController ()
  4.  
  5. @end
  6.  
  7. @implementation ViewController
  8.  
  9. - (void)viewDidLoad {
  10. [super viewDidLoad];
  11. // Do any additional setup after loading the view, typically from a nib.
  12. UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Title"
  13. message:@"Message"
  14. delegate:self
  15. cancelButtonTitle:@"cancel"
  16. otherButtonTitles:@"other1",@"other2",nil];
  17.  
  18. [alert show];
  19. }
  20.  
  21. - (void)didReceiveMemoryWarning {
  22. [super didReceiveMemoryWarning];
  23. // Dispose of any resources that can be recreated.
  24. }
  25.  
  26.  
  27. -(void)alertView:(UIAlertView*)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
  28. {
  29. if (buttonIndex == 1) {
  30. NSLog(@"1");
  31.  
  32. }else if (buttonIndex == 2){
  33. NSLog(@"2");
  34. }else if (buttonIndex == 0){
  35. NSLog(@"0");
  36. }
  37.  
  38. }
  39.  
  40. @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement