Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8520777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:37:34+00:00 2026-06-11T06:37:34+00:00

I’m learning cocoa (not ios) and I want to understand and implement MVC in

  • 0

I’m learning cocoa (not ios) and I want to understand and implement MVC in all the code I create. I have learnt and understand the logic for this design and I am trying to use it in my apps (very small apps from lessons and tutorials etc..).

Most tutorials show examples of MVC in just 2 files. The Model and the appController together in one class/file (a sub class of NSObject) and then the view obviously in its own file (NSView).
But when I think of MVC, I always think of 3 classes in 3 files:

Class/file 1. The Model e.g. names, people, ages , arrays etc..
Class/file 2. The appController – the brain e.g. give person a name and age etc…
Class/file 3. The view e.g. show the person in a window.

So should the model always be in a separate file from the controller?

The other question is regarding communication – On the above example, how would the Model and appController share data ? Would the Model be a subclass of the appController (appController a subClass of NSObject) so both can share ivars ??

Thanks for reading this and I hope you can clear my confusion.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T06:37:35+00:00Added an answer on June 11, 2026 at 6:37 am

    It is true that the Model is somewhat more abstract than the View and ViewController.

    The Model may be a class but if it is a straightforward model, (say just a single value that the ViewController can get from some other ViewController) it may just be in the ViewController.

    The key point is that the View never owns its own data, it just displays it.
    Lecture 1 in CS193P has a lot of good illustrations and has a download of the lecture as a pdf here

    Also, although a view should never own its own data, where that data is entirely derived from what is in the view (a box in the view for instance whose size is derived from the amount of data received), that box size could be worked out by the View when it is drawing itself.

    Also, there is an example of the Calculator that this lecture refers to here.
    I learned a great deal about the concepts in these places. I just struggle with syntax now.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have patience with me, I'm still learning Cocoa Touch. Other -viewDidLoad not being called
I'm currently trying learning Cocoa and I am not sure if I understand that
I'm learning objective-C and Cocoa and have come across this statement: The Cocoa frameworks
I am learning Cocoa and trying to create an application for Mac that displays
Learning some VBA. So far, I've constructed this piece of code which should allow
I still have a long way to go learning Cocoa. I'm trying to learn
I have an html code stored in a string. Now I want to extract
I have a bunch of code in an iOS project (named MyLibs) I re-use
I am learning iOS development in Objective-C, and I have found a lot of
I'm just learning Objective-C/Cocoa programming for the Mac. All of the tutorials, books, blogs,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.