Reputation: 1622
I am working with XCode 6.3 & Swift.
I have just added a few view controllers in my storyboard & added the custom classes & set the respective custom classes in identity inspector.
But while I run the app it shows Unknown class X in Interface Builder file. & I am not able to interact with my custom classes. There are few similar questions like this & I have tried all the solutions but none of them are working for me.
Upvotes: 1
Views: 3300
Reputation: 511
All my viewControllers were ok, but I searched through he whole storyboard file and found this:
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC" customClass="end">
Removing the custom class got rid of the error:
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
No idea why this custom class was there in the first place.
Upvotes: 2
Reputation: 41
It may seem like a tedious thing but make sure that everywhere you have referenced the view controller it has been spelled correctly. I regrettably spent a lot of time attempting all of the suggestions to fix the error and it turned out to be a simple spelling mistake!
Before:
UIViewController *myViewController = [[FormApplicationViewController alloc] initWithNibName:@"FormApplicationviewController" bundle:nil];
After:
UIViewController *myViewController = [[FormApplicationViewController alloc] initWithNibName:@"FormApplicationViewController" bundle:nil];
Upvotes: 0
Reputation: 47
I restarted my Macbook and all modules started to populate in the Custom Class box. No created classes were showing in the dropdown box.
I'm on Xcode 7.0.1, OSX 10.10.5 on a 2015 Macbook Pro. That was a really annoying error to figure out.
Upvotes: 0
Reputation: 9346
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">
Upvotes: 6