iphone - UISplitViewController - Dealing with memory warnings -


I have a UISplitViewController where the master VC is loaded (UITableViewController) and pressed using a table cell, it makes detail VC (two UIViewController with UIWebViews):

  @implementation MasterVC - (void) tableView: (UITableView *) tableView didSelectRowAtIndexPath: (NSIndexPath *) indexPath {UIViewController * detailViewController = nil; DetailVC * newDetailViewController = [[extensionclock alloc] initWithNibName: @ "DetailVC" bundle: zero]; DetailViewController = newDetailViewController; // Update the view controller array of the split view controller. NSArray * viewControllers = [[NSArray alloc] initWithObjects: self.navigationController, detailViewController, zero]; SplitViewController.viewControllers = viewControllers; [ViewControllers release]; [DetailViewController release]; }  

If I have to continue to simulate a memory warning, DetailVC (called didReceiveMemoryWarning, viewDidUnload, dealloc) but I get a "- [UIView _invalidateSubviewCache]: deallocated sent for example message "error releases I view controller where the line Mastrwu am, which is why it makes sense since it was released due to memory warning that attempts to load Drishykantrolr (Vistarvisi) detail I Scope it looks view since expanded to VC release, I do not fully understand.

Now, if instead didSelectRowAtIndexPath issuance detailViewController inside, I will continue in this viewWillDisappear, everything works fine:

  @implementation MasterVC - tableView (zero) : (UITableView *) TableView selected by the StatusApath (NSIndexPath *) Index pathway {UIViewController * detailViewController = Zero; DetailVC * newDetailViewController = [[extensionclock alloc] initWithNibName: @ "DetailVC" bundle: zero]; DetailViewController = newDetailViewController; // Update the view controller array of the split view controller. NSArray * viewControllers = [[NSArray alloc] initWithObjects: self.navigationController, detailViewController, zero]; SplitViewController.viewControllers = viewControllers; [ViewControllers release]; // WILLDissapear released in the scene // [detailViewController release]; } - (Zero) view specially: (BOOL) Animated ([Super ViewView Size: Animated]; MyAppDelegate * Representative = [[UIApplication Shared Application] Representative]; // Extend VC Reconfiguration and Release It - [UIView _invalidateSubviewCache]: example canceled the message was sent to [[delegate.splitViewController.viewControllers objectAtIndex: 1] release];}  

detail to understand for me, it (a) When the controller is released from view, the master view controller c It will happen, but even then, it seems like a hack (plus static analyzer 'right' in the place of complaint not to release the VC) any other better way to solve it?


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -