I’ve always thought I understood MVC, but lately, after reading a lot of Stack Overflow posts on the subject, I’ve discovered that the ways in which MVC frameworks do things are slightly different from one another. More specifically, in the way in which the view and model interact, there seems to be two schools of thought:
When the user interacts with the view, the view notifies the controller, and the controller in turn does something to the model. When the model changes, the model notifies the controller, which in turn updates the view.
The view subscribes to the model. When the model changes, the view seems to be notified directly that it needs to update itself.
So my question is: In Cocoa Touch (iOS), what is the best way to do MVC? I’m mainly coding for iOS these days and am interested in the best practice for this platform only. (I’m not interested in how ASP.NET, Rails, Backbone, etc. do things.)
It would be wonderful if some KVO example code could be provided. Thanks. =)