Τετάρτη, 28 Μαρτίου 2012

A nice simple example of MVC (Model View Controller) pattern

In the following code from examples of The Big Nerd Ranch Guide (objective C) you can see a nice example of Model -View - Controller pattern in action.


  • We build each view separately. We use the frame to ensure the placing position on the screen. 
  • We connect our instance variables with the views. 
  • We connect the action-target mechanism of UIButton with the BNRAppDelegate as target (via the self pointer that targets on BNRAppDelegate). We also say that the ACTION will be the method addTask (with the action:@selector(addTask:))





Δεν υπάρχουν σχόλια:

Δημοσίευση σχολίου