UIAlert & UIActionSheet<UIActionSheetDelegate>

UIActionSheet *actionSheet = [[UIActionSheet alloc]
           initWithTitle:@"Are you sure?"
           delegate:nil
           cancelButtonTitle:@"No Way"
           destructiveButtonTitle:@"Yes, I'm Sure!"
           otherButtonTitles:nil];
  [actionSheet showInView:m_ClistView->getView()];
  [actionSheet release];

//委托方法

- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex{
   
    switch (buttonIndex)
    {
        case 0: //cancelButtonClick
        {
            [self doSomething];
            break;
        }       
        case 1: //otherButtonClick
        {
            [self doSomething1];
            break;
        }  

            default:            break;    }}

相关文章:

  • 2021-09-18
  • 2021-08-21
  • 2021-07-07
  • 2021-09-29
  • 2022-01-21
  • 2022-12-23
  • 2022-12-23
  • 2021-08-18
猜你喜欢
  • 2022-12-23
  • 2021-11-27
  • 2021-10-09
  • 2022-12-23
  • 2022-12-23
  • 2021-07-18
  • 2021-09-19
相关资源
相似解决方案