UIPopoverController dealloc getting called—ARC environment

拈花ヽ惹草 提交于 2019-12-03 09:59:07

I have run into the same problem and fixed it by retaining the popover controller in a strong instance variable as suggested AND explicitly dismissing it before resetting the property with the new popover controller allocated in in the second run of the action. In your example, you should add something like this:

- (IBAction)createNewScore:(id)sender {
    if (self.pc) {
         [self.pc dismissPopoverAnimated:YES];
    }

If your popover is stored as strong reference, it can't be deallocated. The only possibility when it can be deallocated is in the situation when the object containing the strong reference (self in your example) is also deallocated.

I think the important question is what are you doing with your views when the popover is visible.

If you have already checked this, than it must be a framework bug.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!