fuzzygoat
fuzzygoat

Reputation: 26223

iPhone Application Starting Point?

I have a question regarding setting up a simple single view application. From what I can see there are two methods...

METHOD_001

  1. Start Xcode and create a "Window Based Application"
  2. Start setting up your interface in the MainWindow.xib

METHOD_002

  1. Start Xcode and create a "Window Based Application"
  2. In Xcode add a UIViewController subclass with its own XIB.
  3. In Xcode add an IBOutlet to the delegate to point to UIViewController
  4. In Interface Builder add an instance of UIViewController and link it at the delegate
  5. In Interface Builder select the "NIB Name" the UIViewController will use.

To my mind METHOD_002 would seem to be the way to go for anything other than the most simple of tests. Also its following the MVC methodology, so I would suggest that METHOD_001 is just a starting point and you should always be heading towards METHOD_002?

gary

Upvotes: 0

Views: 374

Answers (1)

Felixyz
Felixyz

Reputation: 19143

Between the two alternatives, the second one looks better for the simple reason that it has more loose coupling, probably making it easier to switch things around later. I'm not sure you could say that it's more MVC, because at this point you don't yet have any model objects, and even with the first method you have both a view controller and a view.

Upvotes: 1

Related Questions