17
I am a newbie in iOS application development, but I am trying to learn how to deal with Cocoa in the best way.
I got stuck trying to understand how to keep and reference the model objects properly.
- many say to write an app delegate property to hold the model and then reference it through the convenience methods for the app delegate singleton.
- others say to "inject" in the view controller only the part of model which it needs (or its subviews needs), but I don't understand how to do this. Via a property? Via an initWithModel: method (and in this case, how can I say to IB to use that method?)
- others again say that the model should be a singleton
- and again, others say to use global variables (!)
Could you please give me some hint (and code samples)? I would like to learn the things in the proper manner, considering that soon I will be moving towards Core Data.