[Objective-C] iphone UIActionSheet - pop up list of options →→→→→进入此内容的聊天室

来自 , 2019-05-31, 写在 Objective-C, 查看 121 次.
URL http://www.code666.cn/view/413894b7
  1. // place this code in a UIViewController subclass
  2.  
  3. - (void)debugButtonPressed:(id)sender
  4. {
  5.         UIActionSheet* action = [[UIActionSheet alloc]
  6.                                                          initWithTitle:@"Menu"
  7.                                                          delegate:self
  8.                                                          cancelButtonTitle:@"Continue"
  9.                                                          destructiveButtonTitle:@"Quit"
  10.                                                          otherButtonTitles:@"Debug",nil ];
  11.         [action showInView:self.view];
  12.         [action release];
  13. }
  14.  
  15. - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
  16.         switch (buttonIndex) {
  17.                 case 0: // continue
  18.                         NSLog(@"Continue");
  19.                         break;
  20.                 case 1: // Quit
  21.                         NSLog(@"Quit");
  22.                         break;
  23.                 case 2: // Debug
  24.                         NSLog(@"Debug");
  25.                         break;
  26.         }
  27. }
  28. //objectc/4008

回复 "iphone UIActionSheet - pop up list of options"

这儿你可以回复上面这条便签

captcha