简体   繁体   English

如何将标签添加到标签栏控制器? (iOS)

[英]How to add tabs to a tab bar controller? (iOS)

I've started an Xcode project with the default tab based layout and i can't seem to figure it out. 我已经开始使用默认的基于标签的布局启动Xcode项目,但似乎无法弄清楚。 I open the main .xib and add a third tab, then associate the tab to the third .xib file, yet when i touch the third tab, the application crashes. 我打开主.xib并添加第三个选项卡,然后将该选项卡关联到第三个.xib文件,但是当我触摸第三个选项卡时,应用程序崩溃。

Error code: 错误代码:

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "thirdview" nib but the view outlet was not set.'

Thanks in advance. 提前致谢。

This error generally means that while your tab bar controller is finding the .xib file that you associated it with, that .xib does not have a link for the view outlet from its "File's Owner" item. 此错误通常意味着,当选项卡栏控制器正在查找与之关联的.xib文件时,该.xib没有其“文件所有者”项中的view出口链接。 Double-check that you've set this property correctly. 仔细检查您是否已正确设置此属性。 (Most xibs will just set it to the view they contain.) (大多数XIB会将其设置为它们包含的视图。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM