①本想花点时间来讲解这玩意的。不过看到了官方文档立马放弃了。
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIActionSheet_Class/
重要的:UIActionSheet已经被IOS8所抛弃。(UIActionSheetDelegate也被摒弃了)如果想闯将并且管理action sheets 在IOS8和以后的版本中可以使用UIAlertController带着preferredStyle的UIAlertControllerStyleActionSheet。
以下是一段使用UIActionSheet的代码。
- (IBAction)logout:(id)sender {
UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:@"确定要注销?" delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:@"确定" otherButtonTitles:nil, nil];
[sheet showInView:self.view];
}