• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Why can't a modal view controller present another in viewDidLoad?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Why can't a modal view controller present another in viewDidLoad?
      • From: Luke Hiesterman <email@hidden>
  • Prev by Date: Re: “EXC_BAD_ACCESS” object is not nil but not accessible
  • Next by Date: Re: Why can't a modal view controller present another in viewDidLoad?
  • Previous by thread: Re: “EXC_BAD_ACCESS” object is not nil but not accessible
  • Next by thread: Re: Why can't a modal view controller present another in viewDidLoad?
  • Index(es):
    • Date
    • Thread