CPr*_*ott 10 crash uipopovercontroller ios ios5 xcode4.2
嗨,我知道我在这里做错了什么.我正在使用ios5,如果我不调用presentPopoverFromBarButtonItem,则不会崩溃.有没有人经历过类似的事?我检查了苹果开发者论坛,谷歌,堆栈溢出,找不到任何东西.
在gdb上运行bt也没有显示任何提示.
UIViewController *viewTwo;
viewTwo = [[ViewTwo alloc] initWithNibName:@"ViewTwo" bundle:nil];
UIPopoverController *popover;
popover = [[UIPopoverController alloc] initWithContentViewController:viewTwo];
[popover presentPopoverFromRect:[theButton bounds]
inView:theButton
permittedArrowDirections:UIPopoverArrowDirectionLeft
animated:NO];
Run Code Online (Sandbox Code Playgroud)
Sco*_*ood 22
我假设你使用ARC,因为我有同样的问题.您必须保留已创建的弹出窗口,否则其保留计数将减少,并且当您到达方法范围的末尾时它将被释放.
因此,创建一个属性并对其进行合成,直到您不再需要它并将其从屏幕中删除,将其设置为nil.
| 归档时间: |
|
| 查看次数: |
3370 次 |
| 最近记录: |