DevPrep

All topics › Software architecture

MVC

Junior PRO

The point

MVC in Cocoa is not the "classic" Smalltalk MVC, and iOS interviews ask about Apple's variant:

The key difference from Smalltalk MVC: there the View observes the Model directly. In Apple's version View and Model do not know each other; only the Controller links them. So a Model is reusable with any UI, and a View with any data.

The rest of this answer, with code and interview follow-ups, is in the DevPrep app.

Read the full answer in DevPrep

Practice this before your interview

DevPrep turns these answers into one-minute challenges: what does this code print, find the bug, mock interviews. One challenge a day.

Get DevPrep on the App Store