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.

  • UIView display issue in iOS 7
  • Simulating system-wide touches in iOS 7
  • Major Bug, Sprite Atlas created in XCAssets Folder does not support batch rendering
  • Supporting iOS 4.3 to iOS 6.0
  • How to compare the types of gestures on iOS?
  • Error: no such file or directory
  • 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?

    8 Solutions Collect From Internet About “Unknown Class **** in Interface Builder file”

    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"

    to this:

    <viewController storyboardIdentifier="StoryboardId" id="SomeID" customClass="CustomClass"
     customModule="AppName" customModuleProvider="target" sceneMemberID="viewController">

    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

    appcode is very stubborn in keeping the old xib cached somewhere, and if you have the cached xib and it has the same name that your controller it will try to load it on start.

    what I do after deleting a .xib:

    1. delete app from the device
    2. clean build folder in app code
    3. invalidate caches and restart, kill appcode before it starts
    4. delete derived data in xcode
    5. start appcode

    step 4 shouldn’t be necessary, but my feeling is that without it I am still seeing the deleted .xib

    If you have multiple targets in your Xcode project, make sure that the class the was mentioned in the error file is compiled for the target you’re testing with as well.

    OK, so I deleted all references to the class causing the problem but still nothing.

    However, I also had a UIViewController subclass called MyViewController. This wasn’t being loaded in any IB file so I don’t know how it was causing the problem.

    I changed the name to MyOtherViewController.

    Build – Run – works.

    I don’t know how or why but it works now.

    I had the same issue when I had multiple class declarations in one file.
    What I did is I declared a UITableViewCell subclass in one of my view controllers, and forgot to put the UITableViewCell subclass’ @implementation in the view controller’s .m file.

    As my experience, All solutions above had not worked out.
    Then I had to re-input the custom class in all strayed Xibs.
    As an amazing result, it just succeeded and what I had done reconnected the lost connection between @interface and IB.
    Hope to be useful.

    This happened to me when I renamed the custom view class, and the module (in the identity inspector when the view is selected) was blank. It remained blank because Xcode didn’t autocomplete the custom class name, hence it left the module blank. All I had to do was re-enter the class name after a build, and then it autocompleted, and selected to appropriate module (Current – Target)

    enter image description here