Unknown class in Interface Builder file [duplicate

2019-03-24 11:21发布

This question already has an answer here:

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?

8条回答
Evening l夕情丶
2楼-- · 2019-03-24 12:06

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.

查看更多
Emotional °昔
3楼-- · 2019-03-24 12:08

In my case this error appeared after refactoring class name. Somehow the classname not changed in the .xib file. I opened this xib-file in Textedit and replace all OldClassVC to NewClassVC. Then I saved xib-file and Cleaned project before new build. Project runs well.

查看更多
登录 后发表回答