Xcode 6 Bug: Unknown class in Interface Builder fi

2018-12-31 16:33发布

I upgraded to Xcode 6 beta 4 and now my App continuously crashes with the message

Unknown class X in Interface Builder file.

It crashes because supposedly Xcode can't find my custom classes that I have linked in my Storyboard but it shows that they are linked correctly in the Xcode interface.

I'm positive everything is linked correctly. My only other option may be to delete the entire storyboard file and start from scratch because it might be corrupted somehow.

Edit: I would also like to add that I tried cleaning, reseting simulator, messing with build phases etc. None of that works.

30条回答
孤独寂梦人
2楼-- · 2018-12-31 16:35

My answer: set custom Module equal to the custom Pod name (in my example - custom class name) like on the screenshot attached

This solution is for a specific case: for custom views classes from Pod (or Carthage) framework.

Infrastructure: XCode8, Swift3

enter image description here

查看更多
看风景的人
3楼-- · 2018-12-31 16:35

I faced the problem when I ported the storyboard from Swift project to Objective-c project, noticing vvkuznetsov's answer, it turned out the two project using same identifier. I "Product -> Clean" and tap Enter key on the Module and Class text field. the issue went away.

查看更多
皆成旧梦
4楼-- · 2018-12-31 16:36

My solution was to remove @objc from Custom class definition.

查看更多
明月照影归
5楼-- · 2018-12-31 16:37

This worked for me..

Check your compiled source, whether that file(e.g; ViewController.m) is added or not, in my case ViewController file was not added so it was giving me the error..

enter image description here

查看更多
美炸的是我
6楼-- · 2018-12-31 16:39

Selecting the proper Module for my Custom Class I solved this problem .

Here it is :

enter image description here

查看更多
皆成旧梦
7楼-- · 2018-12-31 16:40

These steps work for me.

1) Clear Derived Data.
2) Remove .h and .m files
3) Create .h and .m files Again

查看更多
登录 后发表回答