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

  • SEARCH
  • Home
  • 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 5990955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:19:05+00:00 2026-05-22T23:19:05+00:00

I really can’t seem to get the hang of Model objects in MVC. I

  • 0

I really can’t seem to get the hang of Model objects in MVC. I wonder why we can’t just work with arrays and dictionaries and arrays OF dictionaries?

I understand that they represent the ‘data’ that my other classes manipulate and work with. But what is the proper way they should be constructed? Suppose I’ve got a plist I want to read and display in a table view. I could just load it directly into an array property in my viewDidLoad method and then use it, right? Why would I want to use a Model class, and how would I go about constructing it?

In addition, any links to resources/blogs out there that explain this point would be greatly appreciated!

  • 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-05-22T23:19:06+00:00Added an answer on May 22, 2026 at 11:19 pm

    You absolutely can work with dictionaries and arrays — there’s nothing wrong with using those as part of (or all of) your data model. Core Data’s NSManagedObject is very much like a dictionary. But sometimes you want your model objects to do more than just store data — you might also want them to know something about how the various bits of data relate to each other, operate on the data, and so forth.

    Consider how you’d represent a Person in your data model. Could be a dictionary, right? With keys like firstName, lastName, middleName, address, phone, email, dateOfBirth… If you use a plain old dictionary, mutable or not, you just store the appropriate value for each key and you’re done. If that’s really all you need, you’re done.

    On the other hand, you can derive a lot of other information from those fields without needing to store extra data. If you create a custom Person class, you can give it keys like fullName, age, initials, monogram, and vCard. The custom class could have methods for each of those that manipulate the stored information to come up with the appropriate values. Example:

    - (NSString*)fullName
    {
        return [NSString stringWithFormat:@"%@ %@ %@", self.firstName, self.middleName, self.lastName];
    }
    

    That’s just a very simple example. Maybe your app manages the entire inventory of a group of warehouses. In that case, you’d probably want classes representing part, bin, palette, location, supplier, destination, order, invoice, forklift, operator, etc. When someone picks a part from a bin, you’d want that bin to know how many parts are left and send a notification if the number is smaller than some threshold. That notification might trigger an event that tells a forklift to go get another palette of that kind of part and deliver it to the bin. Once picked, the part should be transferred from the bin to an order. The order, of course, should know how to generate an appropriate invoice. And so on. All this logic can be part of the model.

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

Sidebar

Related Questions

This may be something trivial but I really can't get it to work, I
I really can't understand why i get a EXC_BAD_ACCESS in the line where I
really can't understand, how to build correctly project that uses boost.python. I've included boost_(python/thread/system)-mt.
I really can't understand how the below piece of code is working... options.each {
I really can't work out how to best do this, I can do fairly
I've read through other questions but to no avail - I really can't work
I'm trying to understand amazon php sdk for AWS but I really can't use
I have 2 major problems with the Flex (4.6) SoapDecoder, I really can't get
I try to parse encrypted &RQ history, but i really can't understand asm code.
I really can't work out what's going on here. I'm using the jQuery load()

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.