将笔尖连接到文件所有者问题

发布于 2024-11-27 23:04:37 字数 485 浏览 1 评论 0原文

所以我正在升级我的 iPhone 应用程序以实现通用。我升级了项目,然后为我的一个课程创建了一个新的笔尖。我将该笔尖的自定义类设置为我的 viewController 并将视图从文件所有者拖动到笔尖。一切都很好。但第二次运行它时,我收到以下错误:

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException',
reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the
"viewControlleriPad" nib but the view outlet was not set.'*** Call stack at first
throw:

所以我断开了视图与笔尖的连接,然后重新连接它并且它起作用了。所以基本上这个模式似乎是每次我链接它时,它就会工作一次。这看起来真的很奇怪。预先感谢您的任何帮助。

So I am upgrading my iPhone app to be universal. I upgraded the project and than created a new nib for one of my classes. I set the custom class for that nib to my viewController and dragged the view from files owner to the nib. All worked fine. But than the second time I ran it, I got the following error:

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException',
reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the
"viewControlleriPad" nib but the view outlet was not set.'*** Call stack at first
throw:

So I disconnected view from the nib, than reconnected it and it worked. So basically the pattern seems to be every time I link it, it works once. This seems really weird. Thanks in advance for any help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

爺獨霸怡葒院 2024-12-04 23:04:37

在创建的新 XIB 中,我想您尚未将 File's Owner 的类与视图控制器的类关联起来。

此外,您还没有设置文件的所有者。

希望你能明白。

如果您需要更多帮助,请告诉我。

编辑:

请参考这个问题:

Iphone sdk tabbar View Outlet was not set

编辑2:

查看对象未连接到文件所有者

In the new XIB that is created I suppose you have not associated the class of the File's Owner with the class of the view controller

Also you have not set the view outlet of the File's Owner.

Hope you get it.

If you need more help than please let me know.

EDIT:

Please refer to this question:

Iphone sdk tabbar View outlet was not set

EDIT-2:

View Objects don't connect to the File's Owner

自我难过 2024-12-04 23:04:37

我以前也发生过这种情况。值得尝试按以下顺序尝试以下操作:

  1. 在 xcode 中复制并粘贴您的笔尖,重命名旧笔尖,将新笔尖命名为旧名称
  2. 如果不太麻烦,请从头开始重新构建笔尖
  3. 重新启动 Mac
  4. 检查笔尖的 XML 是否有任何奇怪的地方

(#2 对我有用)

This happened to me before as well. It would be worth a try to try the following in this order:

  1. Copy + paste your nib in xcode, rename the old one, name the new one to the old name
  2. Rebuild the nib from scratch if it is not too much trouble
  3. Restart your Mac
  4. Examine the XML for the nib for any oddness

(#2 worked for me)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文