Ios 单击UIActionSheet按钮后应用程序挂起

Ios 单击UIActionSheet按钮后应用程序挂起,ios,uialertview,uiactionsheet,Ios,Uialertview,Uiactionsheet,我正在尝试使用UIAction表来确认用户的操作。日志打印得很好。。。但是这个应用程序挂起,显示中间的亮圆,就像你做UIAcVIEW视图一样。我相信这很简单。。。但似乎找不到它 -(IBAction)showActionSheet:(id)sender { UIActionSheet *popupQuery = [[UIActionSheet alloc] initWithTitle:@"Are you sure?" delegate:self cancelButtonTitle:@"Cance

我正在尝试使用UIAction表来确认用户的操作。日志打印得很好。。。但是这个应用程序挂起,显示中间的亮圆,就像你做UIAcVIEW视图一样。我相信这很简单。。。但似乎找不到它

-(IBAction)showActionSheet:(id)sender
{
UIActionSheet *popupQuery = [[UIActionSheet alloc] initWithTitle:@"Are you sure?" delegate:self cancelButtonTitle:@"Cancel Button" destructiveButtonTitle:@"Reset Player" otherButtonTitles:nil];
popupQuery.actionSheetStyle = UIActionSheetStyleBlackOpaque;

[popupQuery showInView:self.view];



}


-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 0) {
    NSLog(@"Destructive Button Clicked");
}
else if (buttonIndex == 1) {
    NSLog(@"Cancel Clicked");

}

请发布UIActionSheet,即您创建的位置

[popupQuery release];

实现此处理程序而不是
ClickedButtonIndex

- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex

我使用的是ARC,这就是我没有的原因。这仍然会做同样的事情。我检查过,事实上,ClickedButtonIndex中的一条注释声明“调用此方法后接收器将自动解除”,因此它应该是等效的——抱歉!我还没有把它修好。。但我确定这是因为我是从UIAlertView调用它的。是的,我将它更改为didDismissWithButtonIndex,用于警报视图,它修复了它。谢谢