(I have read many stackoverflow posts on this, and Cocoa MVC in general, but most relate to the sharing of information between View Controllers.)
Given the following:
a DataModel class responsible for the downloading, parsing, verification and storage of (XML or JSON derived) data,
a ViewController class, which will instantiate a single DataModel object, and will need to get information from that DataModel over time (e.g. updating views to reflect changes in the Model)
Q. What is the best practice for handling the notification of model data changes, and the supply of that data to the View Controller?
Approaches I've seen include:
the Model class posts Notifications, supplying the data in the Notification's userInfo dictionary. The View Controller listens for the Notifications, looks at the userInfo. e.g. Apple's SeismicXML sample code.
the Model class defines a Protocol, and the View Controller acts as the delegate, responding to specific protocol methods of the Model.
the Model class keeps a pointer to the View Controller, calls methods or properties in the View Controller directly. (Not a fan of this one, I must say, as it requires tight binding between the Model and Controller.)
I'm leaning towards the Notification approach, but would like to hear the views of other people.