views:

149

answers:

2

In the Stanford iPhone course CS193P assignment 2 (free online course), the step through says to add the model into the NIB via Cocoa Touch Plugin -> Controllers -> Object. Is this for initialization purpose only? Why can't I just instantiate and initialize my model in the awakeFromNib method within the controller class itself?

A: 

You can create the model programmatically, but I find it convenient to let IB take care of it for me.

IB helps you create a singleton, link it to other things and so on.

Kenneth Ballenegger
+1  A: 

You shouldn't really be creating model objects in IB. NIBs should really be exclusively for controllers and views. You then write code to create and link models and controllers

Martin Pilkington