Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Storyboard doesn't contain a controller with identifier 'MainWindow'

I am trying to instantiate an NSWindowController from a storyboard in my OS X app:

NSWindowController *mainWindowController = [[NSStoryboard storyboardWithName:@"Main" bundle:nil] instantiateControllerWithIdentifier:@"MainWindow"];

But this is what I'm getting:

Storyboard (<NSStoryboard: 0x618000008500>) doesn't contain a controller with identifier 'MainWindow'.

But in the storyboard:

enter image description here

It is set. No, there are no other storyboards. Yes, I've tried cleaning the project and the build folder, but nothing changes.

Why would I get this error?

UPDATE: I am building my app, coming back to the storyboard, and I see that Storyboard ID is unset:

enter image description here

How can Storyboard ID get unset by itself?

like image 918
Can Poyrazoğlu Avatar asked Feb 13 '16 11:02

Can Poyrazoğlu


1 Answers

It was definitely a bug with Xcode. Restarting Xcode solved the problem.

like image 134
Can Poyrazoğlu Avatar answered Sep 19 '22 23:09

Can Poyrazoğlu