xcode NSInvalidUnarchiveOperationException: '无法实例化名为 _UITableViewCellSeparatorView 的类'
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22466420/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
NSInvalidUnarchiveOperationException: 'Could not instantiate class named _UITableViewCellSeparatorView'
提问by maicon.peixinho
After Xcode Update (5.1) my app crashes when i try to run in iOS 6.x.
在 Xcode 更新 (5.1) 之后,当我尝试在 iOS 6.x 中运行时,我的应用程序崩溃。
I have an app where I have a custom cell and constraints.
我有一个应用程序,其中有一个自定义单元格和约束。
Auto layout is unchecked for the xib file. The error I get is:
未选中 xib 文件的自动布局。我得到的错误是:
*** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named _UITableViewCellSeparatorView'
*** 由于未捕获的异常“NSInvalidUnarchiveOperationException”而终止应用程序,原因:“无法实例化名为 _UITableViewCellSeparatorView 的类”
I only found one thread about this issue in another forum, but without a solution, just a test that I've done too and got the same error.
我只在另一个论坛上找到了一个关于这个问题的帖子,但没有解决方案,只是我也做过一个测试并得到了同样的错误。
回答by kwatanabe
I was getting the same error after updating to Xcode 5.1.
更新到 Xcode 5.1 后,我遇到了同样的错误。
I was able to get rid of the error by editing the xib for my custom cell.
我能够通过编辑自定义单元格的 xib 来消除错误。
Under Interface Builder Document in the file inspector, I switched "View as" to "iOS 6.1 and Earlier". I also have "Builds for" set to "iOS 6.0 and Later".
在文件检查器中的 Interface Builder Document 下,我将“查看方式”切换为“iOS 6.1 及更早版本”。我还将“Builds for”设置为“iOS 6.0 及更高版本”。
回答by AlexZd
I got same issue and "View as" and "Builds For" didn't help me. I changed "Opens in" - "Xcode 5.0" and it helped.
我遇到了同样的问题,“View as”和“Builds For”对我没有帮助。我更改了“打开方式”-“Xcode 5.0”,它有所帮助。
PS Don't forget to remove app from device/simulator, clean project and restart xcode (not sure which way was right, I did all of them)
PS不要忘记从设备/模拟器中删除应用程序,清理项目并重新启动xcode(不确定哪种方式是正确的,我都做了)
回答by iVader
After installing of Xcode 6.0.1 beta 2, I too was encountered with this problem.
安装 Xcode 6.0.1 beta 2 后,我也遇到了这个问题。
My project has iOS Deployment Target is 6.0
我的项目有 iOS 部署目标是 6.0
Using answer of @AlexZd, I did next actions:
使用@AlexZd 的回答,我做了以下操作:
I found all xibs, which will created / displayed at this moment
Before my actions this xibs had next standard settings:
我找到了所有的xib,此时将创建/显示
在我采取行动之前,这个 xibs 有下一个标准设置:
- So, for every of xibs, selected by me, this settings was changed on next settings:
- 因此,对于我选择的每个 xib,此设置在下一个设置中更改:
Now, check work of it. If this does not works, then do control actions
现在,检查它的工作。如果这不起作用,则执行控制操作
4. 1) Clean your Xcode project by CMD + SHIFT + K, 2) Clean ~/Library/Developer/Xcode/DerivedData folder by hands 3) Remove app from device and then run it via Xcode on this device
4. 1) 用 CMD + SHIFT + K 清理你的 Xcode 项目,2) 手动清理 ~/Library/Developer/Xcode/DerivedData 文件夹 3) 从设备上删除应用程序,然后在这个设备上通过 Xcode 运行它
This solution was checked by me on 3 iPads with IOS6, IOS7 within IOS8 too. This works perfectly on any of them!
我也在 3 台装有 IOS6、IOS7 和 IOS8 的 iPad 上检查了该解决方案。这对它们中的任何一个都非常有效!