Reached while the popover is still visible

-(void)showsearch:(id)sender { SearchViewController *searchview =[[SearchViewController alloc] initWithNibName:@"SearchViewController" bundle:nil]; settingpopoverController = [[[UIPopoverController alloc] initWithContentViewController:searchview] autorelease]; [searchview release]; [settingpopoverController presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; } 

When I click the button, the application crashes and I got the message [UIPopoverController dealloc] reached while popover is still visible. .

+6
ipad uipopovercontroller
source share
3 answers
+3
source share

There are some good discussions here:

Save / free template for UIPopoverController, UIActionSheet and modal view controllers?

UIPopoverController and memory management

Its essence is what you need:

  • set your autoreleased popover save property
  • set the nil property in your dealloc view
  • and also set it to nil in popoverControllerDidDismissPopover.
+6
source share

The problem is that you are installing

 settingpopoverController = 

when do you want to do

 self.settingpopoverController = 

for which an abstract would be correct. The second uses property accessors, the first just uses iVar.

+3
source share

All Articles