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;    }}

你可能感兴趣的:(action)