Created
February 13, 2012 04:54
-
-
Save huobazi/1813804 to your computer and use it in GitHub Desktop.
UIActionSheetDelegate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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