Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy am I still getting -[UIPopoverController dealloc] reached while popover is still visible
    text
    copied!<p>Getting the following error:</p> <blockquote> <p>-[UIPopoverController dealloc] reached while popover is still visible.</p> </blockquote> <p>This is the code causing the problem:</p> <pre><code>-(void) showModalTime:(int)tag { UIViewController* popoverContent = [[UIViewController alloc] init]; UIView *popoverView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 216)]; popoverView.backgroundColor = [UIColor redColor]; popoverContent.contentSizeForViewInPopover = CGSizeMake(200.0, 216.0); // smaller for timePicker timePicker=[[UIDatePicker alloc]init]; timePicker.frame = CGRectMake(0, 0, 200, 216); timePicker.backgroundColor = UIColorFromRGB(0xeedd82); timePicker.datePickerMode = UIDatePickerModeTime; [timePicker setMinuteInterval:15]; [timePicker addTarget:self action:@selector(dateDidChange:) forControlEvents:UIControlEventValueChanged]; [popoverView addSubview:timePicker]; popoverContent.view = popoverView; popoverController = [[UIPopoverController alloc] initWithContentViewController:popoverContent]; popoverController.delegate = (id)self; // &lt;-- this is the line that's causing the crash [popoverController setPopoverContentSize:CGSizeMake(200, 216) animated:NO]; switch (tag) { // displays the popover datepicker case 11: // store open time [timePicker setTag:11]; [popoverController presentPopoverFromRect:tfShopOpens.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES]; break; case 12: // store close time [timePicker setTag:12]; [popoverController presentPopoverFromRect:tfShopCloses.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES]; break; } } </code></pre> <p>PopoverController is defined as an instance variable:</p> <blockquote> <p>@property (nonatomic, strong) UIPopoverController *popoverController;</p> </blockquote> <p>I have marked the line causing the crash; I changed all of my PopoverControllers to instance variables and the problem appeared solved, but now has reared it's ugly head. What else can I do to prevent this?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload