12

like in the title i got a crazy massage and i cannot handle with it

Unknown class info in Interface Builder file.

Every time I run my Project some crazy bugs will appear or some bars disappear. Did anyone know what to do?

CTSchmidt
  • 1,155
  • 3
  • 17
  • 30

11 Answers11

24

Try this, in order:

  1. Product->Clean in Xcode
  2. Delete the app from the simulator or device
  3. Restart Xcode
  4. (Build &) Run again

If this doesn't help, you likely have a reference to a class in the nib or storyboard that you have to manually find and remove.

Brendon
  • 882
  • 6
  • 12
  • 1
    well it was a dumb mistake i made .. and suddenly your second option was awesome i did 1st sol several times then checked d code , i put a half class name in one of my view controller of storyboard and that was the issue . Thanks :) – Vinay Chopra Mar 21 '13 at 14:09
  • Thank you, thank you, thnak you! I wasted HOURS trying to get rid of this, but never figured I would need to delete the app from the simulator. – juhan_h Sep 22 '13 at 10:13
  • 1
    it's disturbing when the "voodoo" treatment is needed. However, it was and it worked. – Max MacLeod May 11 '16 at 13:42
10

The warning may be because you have assigned a removed/deleted custom class name for one of the UIView subclass. In order to fix such scenarios,

Open interface builder class as Source Code by right clicking on it (Open As -> Source Code).
Find your unknown class name in the source file. And handle accordingly.

It worked for me.

QUserS
  • 512
  • 5
  • 13
4

See my answer to https://stackoverflow.com/a/29013058/784318

I did run into this problem today using Swift.

I changed a class Model.h + Model.m to a Model.swift. This object was used in Interface Builder with the class = Model.

As soon as I replaced the object the class could no longer be loaded.

What I had to do was to change the class reference in IB from:

Class = Model
Module = 

to

Class = Model
Module = <TARGETNAME>

You'll find the <TARGETNAME> in the build settings. It is also the name that shows up in your generated Swift-Header: #import "TARGETNAME-Swift.h"

Community
  • 1
  • 1
Besi
  • 22,579
  • 24
  • 131
  • 223
2

I have solved this problem (while using Swift 4 / Xcode 10.1) by going to Custom Class panel, checking 'Inherit Module From Target' (right below Class & Module row).

2

I have got the same issue with Lottie library.

Unknown class AnimationView in Interface Builder file.

It can happens if your class view is in an other module.

To resolve this, go in your IB file (Xib or storyboard) / Show the identity inspector and set correctly the module :

enter image description here

Kevin ABRIOUX
  • 16,507
  • 12
  • 93
  • 99
1

I tend to see these types of errors when you change the name of your view and view controller classes after customizing a view or controller in Interface Builder to that class. I'd go through your views and controllers in your nib or storyboard to see if your custom classes still exist and match accordingly.

You'll run into issues with IB files when you rename or delete the underlying code without updating the IB file. A similar issue occurs when deleting or changing the name of IBOutlets after linking them to an object in Interface Builder. You'll still have the reference in Interface Builder unless you delete it explicitly.

Lastly, you can look at the IB file as a text file. It's an xml document, where you'll see all the class references. You can see if there are any classes there that may not exist in your project anymore.

Tim Edgar
  • 2,143
  • 14
  • 11
  • fabulous hint at "..I'd go through your views and controllers in your nib or storyboard to see if your custom classes still exist and match accordingly." .. This was the key to a long debug session.. all boiling down to a misguided name after forgetting to cap the first syllable of a ViewController name. You'd think the smarts built in could peek around and say "you refer to startupVC, but we only found StartupVC, please advise." – drew.. Jun 08 '18 at 22:34
1

This also happens if you deleted ClassName.m from Build Phases/Compile Sources

EndyVelvet
  • 421
  • 1
  • 4
  • 14
1

I'll restate the problem, with a bit of context from my end, then provide the solution:

I have created a custom Swift framework, and imported the framework project into the workspace. Then, I made the framework a target dependency to my Swift application. Finally, I referenced a class from the framework in Interface builder.

I kept getting the class not found error, and I noticed in the debugger it had the output class was the mangled/unmangled ObjC counterpart ..

The solution:

Simply add your framework header to your ObjC bridging header:

#import <MazKit/MazKit-Swift.h> // In my case, MazKit

Now, the symbols are exported, and you can verify that by cmd + click on the header itself, and you'll see the mangled/unmangled class names.

Mazyod
  • 22,319
  • 10
  • 92
  • 157
0

Project -> General -> Deployment Info -> Main Interface <- clear this field.

It seems you have deleted file Main (Storyboard) but you still have reference to it in project properties.

Vlad
  • 3,465
  • 1
  • 31
  • 24
0

It could be that the file was not copied over in the build process. Goto the Build Phases Tab and check the copy Bundle resources to see if the file is there. If not add to the project clean and rebuild to see if that fixes your issue. This has helps me.

0

I had renamed one of my TableViewCell Class. Nothing worked other than checking the Inherit Module From Target checkbox.

Open the xib file > Goto Identity Inspector while it is selected > Check the checkbox (also make sure the Class name is correct).

Done!