这个是
UIActionSheet实现的
#import "ContatcsTableViewController.h"
@interface ContatcsTableViewController ()后面加上 <UIActionSheetDelegate>
- (IBAction)logout:(UIBarButtonItem *)sender {
UIActionSheet * sheet = [[UIActionSheet alloc] initWithTitle:@"确定要注销?" delegate:self cancelButtonTitle:@"取消"destructiveButtonTitle:@"确定"otherButtonTitles: nil];
[sheet showInView:self.view];
}
#pragma mark - UIActionSheetDelegate(注销实现部分)
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (0 == buttonIndex) {
//移除栈顶控制器
[self.navigationController popViewControllerAnimated:YES];
}
}