4

I have a UIViewController (parent) that calls presentModalViewController with another UIViewController (child) on viewDidLoad.

If parent doesn't have a UINavigationController, then presentModalViewController does nothing. If it has a UINavigationController, then presentModalViewController shows child as expected.

Is this the standard behavior of presentModalViewController or is there something else at play here?

hpique
  • 119,096
  • 131
  • 338
  • 476

2 Answers2

6

It is because you are presenting it in viewDidLoad, try presenting it in viewDidAppear.

Deniz Mert Edincik
  • 4,336
  • 22
  • 24
  • That was it. Thank you! Do you know why and what does the UINavigationController have to do it? – hpique Oct 31 '10 at 09:08
0

Debug your app and look if the child-view isn't nil, if it's nil then it's not standard behavior, otherwise I think it's a standard behavior..

Hope, it helps..

Christian 'fuzi' Orgler
  • 1,682
  • 8
  • 27
  • 51