开发者

Some problem of UINavigationController's parentViewController

开发者 https://www.devze.com 2022-12-26 11:21 出处:网络
navController is class of UINavigationController, I add it toa view whose controller is uiviewcontroller1:

navController is class of UINavigationController, I add it to a view whose controller is uiviewcontroller1:

[uiviewcontroller1.view addSubview:navController.view];

Now, my question is whose is the navController's parentViewController?

(uiviewcontroller1 != n开发者_Python百科avController.parentViewController) is true?


You can use parentViewController in the tabbar, navigation and modal view context.

But, adding it's view directly to some other view, seems like you did without notify anything to the navController.

So, I think it's nothing wrong with (uiviewcontroller1 != navController.parentViewController). Actually, navController shouldn't know anything about uiviewcontroller1 at all, and stay the same as before you add it's subview to unviewcontroller1.

0

精彩评论

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