Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I re-load a searchDisplayController built in Storyboard, after a memory warning?
    primarykey
    data
    text
    <p>This project is for iPhone with iOS 5 using ARC and Core Data.</p> <p>All built in Xcode Storyboards, I have a <code>UITabBarController</code> with a few tabs. Three of these views are <code>UITableViewControllers</code> with a <code>UISearchDisplayController</code> attached. If I simulate a memory warning in the iPhone simulator, whatever views are not active get dumped, and when I tap on the tab for one of these views with the searchDisplayController, NSZombieEnabled tells me <code>-[UISearchDisplayController retain]: message sent to deallocated instance</code>.</p> <p>Here's my <code>-didReceiveMemoryWarning</code>:</p> <pre><code>- (void)didReceiveMemoryWarning { [(PahAppDelegate *)[[UIApplication sharedApplication] delegate] saveContext]; // Release any cached data, images, etc that aren't in use. self.searchWasActive = [self.searchDisplayController isActive]; self.savedSearchTerm = [self.searchDisplayController.searchBar text]; self.savedScopeButtonIndex = [self.searchDisplayController.searchBar selectedScopeButtonIndex]; self.fetchedResultsController.delegate = nil; self.fetchedResultsController = nil; self.searchFetchedResultsController.delegate = nil; self.searchFetchedResultsController = nil; // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; } </code></pre> <p>My best guess is that the <code>UITableViewController</code> dumps the subviews as well, and for whatever reason, it's not re-creating them when I go back to the other tabs. Since all of that functionality is built in Storyboard, I'm not quite sure how to go about requesting it re-load the <code>searchDisplayController</code> in question.</p> <blockquote> <p>Note: I've never seen the app do this in the real world on the device (and neither have my beta testers), but I don't want Apple to refuse approval of the app because of this; plus fixing it seems like The Right Thing to Do.</p> </blockquote> <p><code>searchDisplayController</code> is a readonly property, so I'm not sure what tack to take to get things loaded like they should be.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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