views:

35

answers:

3

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?

A: 

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..

fuzi-
Not sure I understood. The child view controller is not nil.
hgpc
+1  A: 

Modal views are not related in any way to navigation controllers. What do you mean by "parent doesn't have a UINavigationController"? Also, some code will be useful.

Paul Ardeleanu
A: 

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

Deniz Mert Edincik
That was it. Thank you! Do you know why and what does the UINavigationController have to do it?
hgpc