Unknown class in Interface Builder file
Solution 1
It turns out the bits on the iPhone simulator were out of sync with XCode. I did a 'Reset Content and Settings' and everything works :) Who knew?
Solution 2
If you go to Build Phases within your targets you will see Compile Sources. Make sure each of the m files you need are listed. If not, just add it here and the warning should go away.
Solution 3
Right click on Storyboard --> Open As --> Source Code
Find your unknown class name in the storyboard source file. It may be because you have accidentally assigned a custom class name for one of your UIView subclass'.
Solution 4
I did some research and found out that
for my case
I just need to right click to complaining file in the Project Navigator.
Choose View/Utilities/Show File Inspector.
And for some reason the Target Membership
was not selected.
That's why the linker says that it doesn't know the existence of the class.
I just ticked to choose it and everything works like a charm.
Solution 5
what fixed it for me was t smply "delete" the ap in the simulator, and rebuild again.
Probably this class was still rerenced in local settings in the iphone simulator.
Comments
-
tg2 over 3 years
I created a fairly simple iPhone app. Then figured I'd create an iPad version (Universal) of the app. Tried using the 'upgrade' option and that didn't work-out. So I created a separate universal app and copied the xib files into my project. That didn't work out either, so I deleted the xib files (and their associated .m & .h files.
Now, when I run the iPhone version it gives me the Unknown class iPadSample1AppDelegate in Interface Builder file. error and UISplitViewController is only supported when running under UIUserInterfaceIdiomPad and then it exits. So, I restored to the snap-shot I took before embarking on the iPad adventure... I get the same error. I've tried the XCode search and Spotlight search. There is no reference to that class or the UISplitViewController anywhere in my project, but for some reason XCode thinks that there is.
Is there some way to remove a reference that doesn't exist? LOL
Update:
It may have something to do with my XCode environment being jacked. After finding a few other posts on here, I tried a Clean All / Build / Touch and when I did the touch, I got the following error in XCode:
Uncaught Exception:
-[XCBuildLogWarningMessage setFileLocations:]: unrecognized selector sent to instance 0x2014dd0a0
Anyway to reinstall XCode without messing up everything else?
-
jbjon almost 13 yearsThanks! You've just saved me time trying to debug this further. It makes sense now that the debug information we see is announced from the iOS Simulator. But what wasn't obvious was that the app wasn't getting freshly deployed each time. It's all very well clearing out the Derived Data in XCode 4's Organizer view, but if the IB files on the iOS Simulator are still old then it's no wonder it's throwing out odd error. Thanks for the discovery
-
Leandro Alves over 12 yearsI also had this problem, but this solution didn't work for me. My problem was related to the class not being included at Copy Bundle Resources. Cheers,
-
Thromordyn about 12 yearsFixed it for me. Xcode has problems with adding/moving files.
-
Jens Bergvall almost 12 yearsThanks, saved me from a lot of possible headaches.
-
zanussi almost 12 yearsAdding the files to Compile Sources did the trick for me, @Thromordyn might be right that Xcode isn't adding files properly.
-
CBGraham almost 12 yearsMy symptom: Refactor->Rename, crash on launch with "Unknown class: TheOneYouDeletedDerp". Sounds like there are similar issues with other valid solutions, but mine was fixed with this Reset solution if anybody has done the same thing.
-
Nate Potter over 11 yearsI just deleted the app from the simulator and that worked.
-
shem over 11 yearsSaved me after 2 hours debugging! used an ipod and uninstall the app was solve it, thx!
-
kfmfe04 over 11 yearstyvm - u just saved me 2 hrs of debugging - IDEs are great when you know all the issues, but often a PITA when you're just learning...
-
Philip007 about 11 yearsExactly my case. And good to know a new way to open xib file
-
Typo Johnson almost 11 yearsThis worked for me. I had rearranged the source files around into a real folder hierarchy so I don't have a long list of files in one folder (why isn't this is the default xcode behaviour?). Afterwards most of my source files simply weren't being compiled even though they are in the xcode solution!
-
Shobhakar Tiwari almost 9 yearsthis should be right answer . Thanks