Quote:
Originally Posted by dynamite88
Hi there.. this is an old entry, but was hoping you can share your solution to the invalid references in the new viewcontroller.
|
This whole thread discusses something you should not do: hosting one view controller's view inside another view controller. The system is built around the idea that a view controller manages the entire screen.
The good news is that with iOS 5, it is now possible (easy, even) to do exactly what everybody here is trying to do.
You make one view controller the parent view controller. It adds all the view controllers that will display content inside it as child view controllers using the new addChildViewController method.
Then install a view controller's view as a subview of the parent view controller. When you're ready to swap it, use the new method transitionFromViewController:toViewController:dura tion

ptions:animations:completion:. That method includes several transtions "for free", and also takes an animation block that makes it trivial to do slides, cross-fades, and other transitions that change animatable view properties.