xcode 已知现有 VC 的“Interface Builder 文件中的未知类”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16842259/
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
"Unknown class in Interface Builder file" for known existing VC
提问by MichelleJS
I am building an app in Xcode 4.6.2 . Everything was working fine until I added a storyboard from a previous version of the project, cut and pasted a view from the old storyboard and then deleted the old storyboard. No I am getting "Unknown class nameOfAnActualClassinMyProjectin Intefrace Builder File" . This class a viewController but not the ViewController for the view I just pasted in. I have read alot of questions and answers on this topic and have unsuccessfully made many attempts to fix this. Also I am not using the simulator for this project only the actual iphone.
我正在 Xcode 4.6.2 中构建一个应用程序。一切正常,直到我从项目的先前版本中添加了一个故事板,从旧故事板中剪切并粘贴了一个视图,然后删除了旧故事板。不,我收到“ Intefrace Builder 文件中的未知类nameOfAnActualClassinMyProject”。这个类是一个viewController,但不是我刚刚粘贴的视图的ViewController。我已经阅读了很多关于这个主题的问题和答案,但多次尝试解决这个问题都没有成功。此外,我没有在这个项目中使用模拟器,只使用实际的 iphone。
- Looked for any inappropriate references in storyboard
- I have cleaned the app and then built it again
- I have deleted the app from the phone
- I have deleted the file which seems to be causing the problem and added it back in.
- I have reset the phone and reprovisioned (I read one answer where the problem had to do with old files in the simulator.
- 在故事板中寻找任何不适当的参考
- 我已经清理了应用程序,然后重新构建了它
- 我已经从手机中删除了应用程序
- 我已经删除了似乎导致问题的文件并将其重新添加。
- 我已重置电话并重新配置(我阅读了一个答案,其中问题与模拟器中的旧文件有关。
Also the view from the unknown view controller seems to correctly display.
来自未知视图控制器的视图似乎也正确显示。
The app doesn't crash however it displays a warning in the output log. Any help would be appreciated. thanks.
该应用程序不会崩溃,但会在输出日志中显示警告。任何帮助,将不胜感激。谢谢。
回答by Michael Rogers
Did you check to make sure that your file is being compiled? Click on the Target > Build Phases > Compile Sources.
您是否检查以确保您的文件正在被编译?单击目标 > 构建阶段 > 编译源。
Ciao!
再见!
回答by Bruno
Did you add any new class to the new view controller, that wasnt on the previous storyboard? Did you right click on each storyboard panel to see if you have any yellow warnings in the connections board?
您是否向新的视图控制器添加了任何新类,这在以前的故事板上没有?您是否右键单击每个故事板面板以查看连接板中是否有任何黄色警告?
Regards.
问候。
回答by clocksmith
I had this problem recently. To fix it, I deleted the 2 lines that had references to storyboard in
我最近遇到了这个问题。为了修复它,我删除了在
Supporting Files/<my app>-Info.plist