Documet Link
On iOS 6 and Later, a View Controller Unloads Its Own Views When Desired
Listing 4-3 Releasing the views of a view controller not visible on screen
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Add code to clean up any of your own resources that are no longer necessary.
if ([self.view window] == nil)
{
// Add code to preserve data stored in the views that might be
// needed later.
// Add code to clean up other strong references to the view in
// the view hierarchy.
self.view = nil;
}
}
The Condition should be [self isViewLoaded] && [self.view window] == nil
0 comments:
Post a Comment