开发者

presentModalViewController does nothing

开发者 https://www.devze.com 2023-01-22 23:08 出处:网络
I have a UIViewController (parent) that calls presentModalViewController with another UIViewController (child) on viewDidLoad.

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 UINavigationControll开发者_运维问答er, then presentModalViewController shows child as expected.

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


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消