如何在Xcode 4中设置NSZombieEnabled和CFZombieLevel执行我的可执行文件?
在我当前的应用程序中,当我单击工具栏按钮时,我正在尝试创建一个菜单屏幕apear.我发现最好的方法是使用UIPopoverController来显示我创建的自定义视图.但是,关于我当前代码的一些内容存在缺陷.当我运行我的应用程序并按下按钮时,我收到一条错误消息,表示当弹出窗口仍然可见时它正在达到dealoc.即使看了几个类似问题的例子,我也不能为我的生活弄清楚如何解决这个问题.这是我的代码:
-(IBAction)newMenu:(id)sender{
newTaskWindow *newTaskWin = [[newTaskWindow alloc]init];
UIView *test = [[UIView alloc]init];
test = newTaskWin.view;
UIPopoverController *taskPop = [[UIPopoverController alloc]initWithContentViewController:newTaskWin];
[taskPop setDelegate:self];
[taskPop presentPopoverFromBarButtonItem:newTaskButton permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
[taskPop setPopoverContentSize:CGSizeMake(400, 500)];
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?提前致谢
}
这是它产生的错误:
*** Terminating app due to uncaught exception 'NSGenericException', reason: '- [UIPopoverController dealloc] reached while popover is still visible.'
*** First throw call stack:
(0x381fb8bf 0x37d471e5 0x381fb7b9 0x381fb7db 0x32065f71 0x37d430c5 0x37d44db7 0x2ecf 0x38155435 0x31cbe9eb 0x31d843cf 0x38155435 0x31cbe9eb 0x31cbe9a7 0x31cbe985 0x31cbe6f5 0x31cbf02d 0x31cbd50f 0x31cbcf01 0x31ca34ed 0x31ca2d2d 0x37f29df3 0x381cf553 0x381cf4f5 0x381ce343 …Run Code Online (Sandbox Code Playgroud)