Skip to content

Instantly share code, notes, and snippets.

@huobazi
Created February 13, 2012 04:54
Show Gist options
  • Save huobazi/1813804 to your computer and use it in GitHub Desktop.
Save huobazi/1813804 to your computer and use it in GitHub Desktop.
UIActionSheetDelegate
#pragma mark-
#pragma mark UIActionSheetDelegate with logOff
- (void) onLogOffButtonClick:(id)sender{
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"确认要退出登录吗?" delegate:self cancelButtonTitle:@"不退出" destructiveButtonTitle:@"退出" otherButtonTitles:nil, nil];
[actionSheet showFromTabBar:self.navigationController.tabBarController.tabBar];
XX_RELEASE_SAFELY(actionSheet);
}
- (void)logOff{
// do logoff
[self.navigationController popViewControllerAnimated:YES];
}
- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex; {
switch (buttonIndex) {
case 0:
[self logOff];
break;
case 1:
[self.tableView deselectRowAtIndexPath:[self.tableView indexPathForSelectedRow] animated:YES];
break;
default:
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment