how to pass data from table view to second view controller?

In Model-View-Controller pattern should the controller fetch the data or the the model?

  • In Model-View-Controller pattern should the controller fetch the data or the the model should update data based on inputs from controller ?

  • Answer:

    If you want to get data, the model should fetch the data, and the controller should query the model for that data. If you want to update data, the controller should pass the data to update to the model, and the model should update the data.

John Kurlak at Quora Visit the source

Was this solution helpful to you?

Other answers

fetching the data from the database/api should be handled by the controller. Inputs from the View/UI and updating the UI based on inputs (Your Business Logic) is both Controllers' and Models' work. They are mainly different topics. The main reason to use MVC is the separation of Concerns where your business logic (calculations, database interactions etc.) should be clearly separated from the UI Logic (presentation layer)

Kubilay Oj

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.