【发布时间】:2011-07-02 16:47:28
【问题描述】:
UIActionSheet 在第二次出现后崩溃..
.H 文件
..UIActionSheetDelegate>{
UIActionSheet *popupQuery;
}
@property (nonatomic, retain) UIActionSheet *popupQuery;
.M 文件
-(IBAction)showActionSheet:(id)sender {
if (popupQuery.visible) {
NSLog(@"popupQuery isVisible");
[popupQuery dismissWithClickedButtonIndex:-1 animated:YES];
return;
}else{
popupQuery = [[UIActionSheet alloc] initWithTitle:@"Title" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Readibility" otherButtonTitles:@"Email URL", @"Print", nil];
popupQuery.actionSheetStyle = UIActionSheetStyleBlackOpaque;
//[popupQuery showInView:self.view];
[popupQuery showFromBarButtonItem:actionButton animated:YES];
[popupQuery release];
}
}
【问题讨论】:
标签: ipad crash uiactionsheet