PDA

View Full Version : Xcode doesn't make View Controllers by default anymore




gwelmarten
Feb 20, 2013, 11:27 AM
Hi

I've had a couple of Mac Apps on the go for the last couple of years. Now I want to make a new one.

Problem is, when I make a new Cocoa app in Xcode for OS X, it only gives me the appDelegate.h/m and MainWindow.xib (which has as a sub file 'Window - [AppName]', with a view inside it.

When I've made my apps before, I've had View Controllers referring to each view on OSX. Why has this changed? How do I set Xcode up again to do this?

Thanks,

Sam



xShane
Feb 20, 2013, 12:07 PM
Hi

I've had a couple of Mac Apps on the go for the last couple of years. Now I want to make a new one.

Problem is, when I make a new Cocoa app in Xcode for OS X, it only gives me the appDelegate.h/m and MainWindow.xib (which has as a sub file 'Window - [AppName]', with a view inside it.

When I've made my apps before, I've had View Controllers referring to each view on OSX. Why has this changed? How do I set Xcode up again to do this?

Thanks,

Sam

File > New File > Objective-C Class > Subclass of NSWindowController (Check "XIB for user interface").

gwelmarten
Feb 20, 2013, 12:41 PM
File > New File > Objective-C Class > Subclass of NSWindowController (Check "XIB for user interface").

Yes, but then this XIB isn't automatically used when the application is built and run, like used to happen when it made them automatically.

xShane
Feb 20, 2013, 03:14 PM
Yes, but then this XIB isn't automatically used when the application is built and run, like used to happen when it made them automatically.

Make sure the window appears at start up (you can do so in the inspector panel to the right).