In the latest version of XCode(8.3.2) (and Swift 3.1… though Swift not relevant here), there’s no longer a “MainMenu.xib”, it’s replaced by “Main.storyboard”. If you try to delete this, the app builds but crashes on run, as it’s internally connected to the storyboard controller. (If you don’t delete it the app runs but with two windows… as you might expect) What to do: in the Main.storyboard xib, delete the controller and the window…leaving only the menu. I don’t know if this is the best solution but it solves the immediate problem, though it leaves you with an odd looking project…two xib files: there must be a better way!
You can still build an application without the main.storyboard file, but you will need to do a little bit of extra work.
Try the following first.
- Create a new project for a Cocoa Application.
- Delete the Main.storyboard file.
- Add an Application.xib to the project:
- Choose New File…, then Application from the User Interface section.
- Change the Application’s Main Interface:
- Activate the project-and-target-lists editor and select the target.
- In the Deployment Info section, change Main Interface to Application.xib.
- Finally, add a ViewController object to the project and connect its view outlet to the window’s view object.
Many thanks for this ibex10.
I tried it out and it works well, and i learnt a few new tricks/insights for which i’m very grateful. But IMHO we end up with the same structure as the original storyboard structure, with different names for the parts ? I was trying to find a way of following the book’s approach of a MainWindowController class etc with its outlets and actions. But no matter how much i modify the settings: delivery info, application.xib name, files owner Class etc… and it builds fine, there are always issues of connectivity, setters…in the run time messages. After a lot of possibilities, I could only conclude that the book’s approach is now dead, or needs so much unwinding of the current XCode defaults as to make it not worthwhile ? Though i don’t know enough to justify any definite conclusion !