Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unknown Window class (null) in Interface Builder file, creating generic Window instead

My app uses storyboards and the windows have to use a custom class, MyWindow for example, or at runtime/launching the app, there is an error message saying:

Unknown Window class (null) in Interface Builder file, creating generic Window instead

I just noticed this after upgrading to Xcode 9.1, but I'm not sure if it was there before.

A similar question is here: Xcode 6 Strange Bug: Unknown class in Interface Builder file

Update:

My other project doesn't have this issue. I will investigate it later.

Update2:

In both projects, a window is owned by a custom window controller. I checked the storyboard xml but didn't find anything odd.

like image 639
LShi Avatar asked Nov 01 '17 09:11

LShi


3 Answers

This warning also occurs when I build and run a brand new empty project in Xcode 9.1.

Replacing the default NSWindow with an empty custom class of NSWindow with no changes does remove the error, but that behaviour makes no sense.

Therefore, I'm filing it as a bug.

like image 55
applehelpwriter Avatar answered Oct 11 '22 00:10

applehelpwriter


I had the same issue after upgrading to Xcode 9.1. To resolve the error you need to replace all instances of NSWindow in storyboards with custom subclasses of NSWindow.

like image 7
Kaschman Avatar answered Oct 11 '22 01:10

Kaschman


I have the same problem in several projects since the upgrade.

"Unknown Window class (null) in Interface Builder file, creating generic Window instead"

This happens in all Cocoa projects it seems at the moment. Few of them will run properly. However I have no custom window controllers. Replacing the default window controller in Storyboard with a named subclass doesn't change the situation.

Solved: - Creating blank custom window subclass for the default window solves the problem. I was getting thrown by the message appearing after making changes to the project (accidentally deleting my main viewcontroller etc.)

like image 7
CodeCoordination Avatar answered Oct 11 '22 02:10

CodeCoordination