Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unknown Class **** in Interface Builder file

I added a UIView xib file using the root class of MyView.

I created it in the wrong place and so moved it in the project. Same project just a different folder/group.

I then had a problem when running saying...

Unknown Class MyView in Interface Builder file

I couldn't work out what was wrong so I have now deleted the files both from the project and from the directory.

I've done a search using SublimeText2 for the string "MyView" and it doesn't exist anywhere in the project.

I've reset the simulator, cleaned the project and the build folder and deleted derived data.

Still getting the same error.

Any ideas what I can do now?

like image 686
Fogmeister Avatar asked Oct 16 '13 11:10

Fogmeister


3 Answers

Sometimes IBuilder missed customModule="AppName" customModuleProvider="target"

To fix it, open storyboard as source code and replace this line:

<viewController storyboardIdentifier="StoryboardId" id="SomeID" customClass="CustomClass"
sceneMemberID="viewController">

to this:

<viewController storyboardIdentifier="StoryboardId" id="SomeID" customClass="CustomClass"
 customModule="AppName" customModuleProvider="target" sceneMemberID="viewController">
like image 74
ChikabuZ Avatar answered Nov 18 '22 23:11

ChikabuZ


In my case, I solved by checking "Inherit Module From Target" option in Identity Inspector. enter image description here

like image 30
winner.ktw Avatar answered Nov 18 '22 22:11

winner.ktw


Go to View -> Utilities Goto File Inspector of .m file

Open the Target Membership section and make sure that your target is selected for this .m-file

like image 9
Zeeshan Avatar answered Nov 18 '22 21:11

Zeeshan