Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iOS:UIActionsheet(或UIPopoverController视图)变成僵尸_Ios_Uiactionsheet_Zombie Process - Fatal编程技术网

iOS:UIActionsheet(或UIPopoverController视图)变成僵尸

iOS:UIActionsheet(或UIPopoverController视图)变成僵尸,ios,uiactionsheet,zombie-process,Ios,Uiactionsheet,Zombie Process,我有一个UIViewController。用户可以在其中启动UIActionsheet或popover。如果设备旋转,UIViewController将被有意释放。问题是UIActionsheet/popover继续存在,并成为一个僵尸,在之后困扰着我。用户可能会单击“僵尸”中的一个按钮并使应用程序崩溃。我尝试在dealloc或shouldAutorotateToInterfaceOrientation中调用[actionsheet dismissWithClickedButtonIndex:0

我有一个UIViewController。用户可以在其中启动UIActionsheet或popover。如果设备旋转,UIViewController将被有意释放。问题是UIActionsheet/popover继续存在,并成为一个僵尸,在之后困扰着我。用户可能会单击“僵尸”中的一个按钮并使应用程序崩溃。我尝试在dealloc或shouldAutorotateToInterfaceOrientation中调用[actionsheet dismissWithClickedButtonIndex:0 animated:NO]。没有效果。感谢您的建议。谢谢。

我从这篇文章中找到了解决方案:[解雇行动表][1]

[1] :。我试图通过搜索UIViewController视图的子视图或调用viewWithTag方法来调用actionsheet时出错。奇怪的是,它确实返回了一个非nil对象。但使用此对象调用dismissWithClickedButtonIndex不起作用


这篇文章的作者建议使用UIActionSheet指针并在ViewWillopser works中关闭actionsheet。对于上述特定应用程序,我发现在dealloc中减少操作表更有效。

将您的问题标记为已回答。请耐心等待蚱蜢。新用户必须等待一段宽限期才能接受自己的答案。