开发者

UITabBarController never calls initWithNibName on individual tabs?

开发者 https://www.devze.com 2023-01-05 17:53 出处:网络
Is it true that UITabBarController never calls initWithNibName on its child views (individual tabs)?Or have I just set my app up in a really screwed-up way?

Is it true that UITabBarController never calls initWithNibName on its child views (individual tabs)? Or have I just set my app up in a really screwed-up way?

My MainWindow.xib looks like this in interface builder: tab bar in interface builder http://web.mit.edu/keone/Public/tabbar.png

Note that the Window is completely blank while all the action happens in the Tab Bar Controller.

My app delegate calls [window addSubview:tabBarController.view] in application:did开发者_运维知识库FinishLaunchingWithOptions and once that happens we're off to the races!

But when I put breakpoints on the init, initWithNibName:, and initWithNibName:bundle: methods in any of my individual controllers (which are listed in Interface Builder as children of the tabs, as the image above shows), nothing catches.

Thanks in advance!


It doesn't call initWithNibName:, they call initWithCoder: -- initWithNibName: is only called when you programmatically instantiate a class and hand it a xib file to define its subviews from.

(Updated: I remembered wrong, initWithNibName: is never called unless one makes the call oneself.)

0

精彩评论

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