Manage your view controller

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

The most by doing a iPad based APP, the layout of the interface of hope and Sina micro-blog (iPad version), so they have to manage their own sub view controller

Ideas are as follows:

The view controller 1 a root level, a set of sub view controller, a current display controller.

2 if the display a sub view controller view will create a sub view controller, insert the View into the root view controller's view.

3 if you close the sub pages of words, and the view controller view is removed from the root view controller view, while the sub view controller from the collection root view controller removes the root view controller, controller currently display settings for nil

Problems are as follows:

1 how to modify the view controller view frame.

2 why do the third steps, but the child view controller didn't destroy? But life cycle function view controller does not call. For example: the viewDidUnload function (I did some cleaning operation inside)

To solve the problem:

1 sub view controller to add the viewFrame attribute of type CGRect, in the viewDidLoad function view controller begins to set their own self.view.frame = self.viewFrame position.

2 in removing sub view controller life cycle requires manual calling the corresponding function,

    [self.tmpVC.view removeFromSuperview];

 [self.tmpVC viewDidUnload];

self.tmpVC = nil;



Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Adalheid at December 07, 2013 - 7:03 AM