hpique
hpique

Reputation: 120334

presentModalViewController does nothing

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?

Upvotes: 4

Views: 1278

Answers (2)

Deniz Mert Edincik
Deniz Mert Edincik

Reputation: 4361

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

Upvotes: 6

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

Upvotes: 0

Related Questions