Re: viewWillAppear not called with UINavigationController containment
Re: viewWillAppear not called with UINavigationController containment
- Subject: Re: viewWillAppear not called with UINavigationController containment
- From: Matt Neuburg <email@hidden>
- Date: Tue, 27 Dec 2011 09:03:16 -0800
On Tue, 27 Dec 2011 21:51:55 +0800, Roland King <email@hidden> said:
>Wrote my first UINavigationController container yesterday, appeared to work just fine. It's a particularly dumb one which displays the views from two contained UIViewControllers side by side. I'm using it to show on one page what on my iPhone app shows on two pages, by putting the two VCs together side by side.
>
>Running it, viewWillAppear: is not called on either of the two contained VCs.
Your code for adding the view controllers as children is really skanky. I'd start by straightening it out. Remember, each time you add a child controller, your job is to send "add" (and "willMove" is sent automatically) and then "didMove". When you remove a child controller, your job is to send "willMove" (with nil param) and then "remove" (and "didMove" is sent automatically). You must interleave the movement of the subview to or from the interface into the middle of this procedure. So, the dance for adding a child must go:
* "add"
* put it in the interface if it's going into the interface
* "didMove"
See my examples, both in the book online and in the downloadable code examples, for the iOS 5 revision of my book. m.
--
matt neuburg, phd = email@hidden, <http://www.apeth.net/matt/>
A fool + a tool + an autorelease pool = cool!
Programming iOS 4!
http://www.apeth.net/matt/default.html#iosbook_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden