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.
I resolved this issue as I was typing the question. I figured I'd answer my question and leave it here for anyone else who may face this issue when using Xcode 6 beta 4.
To resolve this issue, you need to select each of your custom class objects in Storyboard (this includes any custom views, even the custom view controllers themselves).
Then with those objects selected, open the identity inspector and under "Custom Class" you should see the Module option. Click inside the Module text box, and press enter.
That's it! The current module for all of my custom objects must have been internally incorrectly set somehow in Xcode 6 beta 4. But there was no visual indication of this in the inspector.
Note that if pressing enter inside the Module text box doesn't work, try selecting the arrow to the right and manually select your current module, then clear the text box and press enter. You can also try pressing enter inside the class text box (although this usually is to resolve a different issue).
Here is an image to make things more clear:
Sometimes the controller you are providing loses its target membership from the current application. In that case, pressing enter on the "Module" field will do nothing. Go to the controller and make sure that it has target membership set to the current app.
In my case, the class referenced in the Storyboard / xib did not have Target Membership set.
To fix, give that class's
.h
and.m
files the same Target Membership as your other classes.I had the same problem with Xcode Version 6.1 (6A1052d). I think the problem appears if you renamed your App / Xcode Project.
My solution was to add the module name in the interface builder manually.
I fixed this along the lines of what Laura suggested but I didn't need to recreate the files.
Using XCode 4, in the Project Navigator, select the .m file that contains the class that it is complaining about
Go to View->Utilities->Show File Inspector (this will show the File Inspector to the right, with that .m-file info)
Open the Target Membership section and make sure that your target is selected for this .m-file
When I added my .m file to my project, it didn't add it to my default target for some reason and that caused me to get the error you mentioned.
Sometimes Xcode missed
customModule="AppName" customModuleProvider="target"
To fix it, open storyboard as source code and replace this line:
to this: