Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XCode Unknown class ***** in Interface Builder file

Tags:

xcode

In an app, suddenly it's giving me the error XCode Unknown class ***** in Interface Builder file. I reviewed everything, storyboard, classes, etc.

I try to rename the class but it is the same problem, even I created a new class and copy the code in. I think XCode is taken that from a kind of cache because even properties that I deleted like the icon in the tab bar item are still present in the app when I run it.

What can be the problem?

like image 993
Laure_f_o Avatar asked Dec 05 '12 18:12

Laure_f_o


3 Answers

Also if using a static library, don't forget to add the -ObjC flag to Other Linker Flags in your projects Build Settings tab.

If you have failed to do so, "Unknown class ... in Interface Builder file" will occur when trying to load a view controller from the static library in IB.

Just another case I experienced the error will show.

like image 137
Joe Collins Avatar answered Nov 03 '22 00:11

Joe Collins


I faced a problem when I created a project with the same name that already existed in my projects directory (though it was deleted some time ago). Xcode didn't understood that it's a new project and use build directory of old project as a build directory for a new one. I didn't knew how to completely rebuild project from scratch and I just removed a build directory. In my case I removed /Users/username/Library/Developer/Xcode/DerivedData/ProjectName-suffix. You can find it in Xcode in Project navigator on the left by selecting ProjectName->Products->ProjectName.app and File inspector on the right will show you a full path to file.

like image 45
vvkuznetsov Avatar answered Nov 03 '22 01:11

vvkuznetsov


Sorry, after trying several post I found one solution, delete the folder of the simulator in /...Library/Application\ Support/iPhone\ Simulator/ and removing the class and re-adding it.

like image 36
Laure_f_o Avatar answered Nov 03 '22 01:11

Laure_f_o