Xcode doesn't make View Controllers by default anymore

Discussion in 'Mac Programming' started by gwelmarten, Feb 20, 2013.

  1. gwelmarten
    Expand Collapse
    macrumors 6502

    Joined:
    Jan 17, 2011
    Location:
    England!
    #1
    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
     
  2. xShane
    Expand Collapse
    macrumors 6502a

    xShane

    Joined:
    Nov 2, 2012
    Location:
    United States
    #2
    File > New File > Objective-C Class > Subclass of NSWindowController (Check "XIB for user interface").
     
  3. gwelmarten
    Expand Collapse
    thread starter macrumors 6502

    Joined:
    Jan 17, 2011
    Location:
    England!
    #3
    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.
     
  4. xShane
    Expand Collapse
    macrumors 6502a

    xShane

    Joined:
    Nov 2, 2012
    Location:
    United States
    #4
    Make sure the window appears at start up (you can do so in the inspector panel to the right).
     

Share This Page