【问题标题】:UIViewController class with IBOutlet collection still has connections to no longer existing storyboard具有 IBOutlet 集合的 UIViewController 类仍然与不再存在的情节提要有连接
【发布时间】:2019-03-07 14:19:44
【问题描述】:

所以,我有一个类仍然连接到已删除的 Drawers.storyboard 文件。

如何“清理”或删除与不存在的情节提要的旧连接?

【问题讨论】:

  • 您删除了视图?但是“类”中还有联系吗?
  • 是的,Drawers.storyboard 文件已被删除
  • 您在运行应用程序时遇到错误,对吧?
  • 由于未捕获的异常'NSUnknownKeyException'而终止应用程序,原因:'[ setValue:forUndefinedKey:]:此类不符合键值编码的键按钮。
  • buttons 是奥特莱斯系列之一

标签: ios xcode storyboard swift4 iboutletcollection


【解决方案1】:

修复它。 好像是缓存问题....

我在终端里做了这个:

rm -rf ~/Library/Caches/com.apple.dt.Xcode ~/Library/Developer/Xcode/DerivedData/*

【讨论】:

  • 完美,你修好了。 :)
【解决方案2】:

这里有一个简单的方法来解决这个问题:

1.) Rightclick on your project. 
2.) Show in Finder
3.) Find the "Drawers.storyboard"
4.) Drag it into your project again.
5.) Enter the storyboard and right click on the view.
6.) Remove all connections.

如果我错了,请告诉我,我会修改答案。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-06-02
    • 2013-05-11
    • 2014-08-05
    • 2017-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多