satyanarayana
satyanarayana

Reputation: 275

iOS MVC implementation

I have created an app, now, I need to re-write it in MVC.

I have created model classes say Event which are working fine. I have created a EventsListViewController which contains a tableview which will be notified when Events are loaded from Event model, I need to display the same events in two different table views and they perform different actions when a cell is tapped in each tableview. EventsListViewController should not contain tableview. I need to write two custom views which extends UITableView which uses the same models.

Can any one please suggest me to pass data between custom views <--> viewcontroller <--> model ?

Upvotes: 1

Views: 202

Answers (1)

psci
psci

Reputation: 933

Model -> Controller:

  • Notifications
  • KVO
  • delegates

Controller -> Model

  • direct reference to model

View -> Controller

  • target-action
  • delegates

Controller -> View

  • outlets
  • direct references

You should familiarise yourself with this great course.

Upvotes: 3

Related Questions