UIPopovercontroller dealloc reached while popover is still visible

前端 未结 3 1710
误落风尘
误落风尘 2020-12-04 09:35

I assure you that I did look for an answer in SO for my question but none of them were helpful. Here I got a simple code that should present a UIImagePickerController<

3条回答
  •  攒了一身酷
    2020-12-04 10:15

    Adding what @phix23 answered, create *poc property like this:

    @property (nonatomic, retain) IBOutlet UIPopoverController *poc;
    

    and then change

    UIPopoverController *poc = [[UIPopoverController alloc] 
                                initWithContentViewController:picker];
    

    for

    self.poc = [[UIPopoverController alloc] 
                                initWithContentViewController:picker];
    

提交回复
热议问题