Why can't a modal view controller present another in viewDidLoad?
Why can't a modal view controller present another in viewDidLoad?
- Subject: Why can't a modal view controller present another in viewDidLoad?
- From: G S <email@hidden>
- Date: Sun, 16 Jan 2011 11:33:30 -0800
Hi all.
The Apple doc says this is possible, but it doesn't work when you want
the second modal view controller presented immediately. If you
present a modal view controller that immediately presents another one
in its viewDidLoad method, the second one never shows up. No errors
are reported, so what's going on?
A workaround I've seen people use (which does work) is to have the
ultimate parent instantiate all of the children's modal views, but
that requires every parent to determine (in advance) every view
controller in the hierarchy; obviously that's poor practice. For
example, this works:
[self presentModalViewController:newPictureController animated:NO];
[self.newPictureController
presentModalViewController:newPictureController.picker animated:YES];
This makes it impossible to create controllers that manage their own
modal views upon instantiation. Should the failure to show a modal
view controller from viewDidLoad be regarded as a bug in the SDK?
Anybody have a solution?
Thanks!
Gavin
_______________________________________________
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