Xcode 6 Bug: Unknown Class in Interface Builder File

Xcode 6 Bug: Unknown class in Interface Builder file

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. Finally:

  • Click inside the Module text box, and press enter.
  • Or (update 2022), check the "Inherit Module From Target" option.

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:
Sample Image

XCode 6.3 bug: Unknown class in Interface Builder file

Sometimes Xcode 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">

Unknown class in Interface Builder file - Xcode 8 Swift 3

What ended up solving my problem was creating a new project and seeing how the original Main.storyboard references its .swift file in the XML, which looks like this

                <viewController id="BYZ-38-t0r" customClass="ViewController" customModule="Sandbox" customModuleProvider="target" sceneMemberID="viewController">

where the important aspect is customClass="ViewController"

By taking this, and editing my project's TutorialView.storyboard by hand and adding in customClass="TutorialViewController I resolved the error.

Xcode 6 Unknown class in Interface Builder file

It is cause when you change the name of a IBOutlet property in your .h/.m which you've already connected up to File's Owner in the nib.

From your nib:

Select the object in IB and go to the 'Connections Inspector'.
Under 'Referencing Outlets' make sure that your object isn't still connected to the old property name... if it is, click the small 'x' to delete the reference and build again.

Xcode 7.1 Swift 2 Unknown class in Interface Builder file

In storyboard below the Custom Class field the module is set to None. Change that to your app module or just remove and enter class again, it should set to default like this:

Sampel Image

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

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.



Related Topics



Leave a reply



Submit