Error: use of unresolved identifier 'mainWindowController'

What am I doing wrong?

The others might correct me if I’m wrong here, but I think the breakpoint at which your application stops needs to be in the context of AppDelegate.swift, so that it knows what mainWindowController is. Your breakpoint is in MainWindowController.swift, and in that context there is no mainWindowController variable.

Did you get everything set up correctly for a single view app the way the book describes? For instance, do you have theoverride var windowNibName: String? { return "MainWindowController" } statement in your code along with the appropriate changes to AppDelegate?

If you want to post your project folder, I’ll be glad to take a look.

I had this problem as well.

I moved the breakpoint to:

self.mainWindowController = mainWindowController

in the AppDelegate.swift file and everything worked as shown in the book.