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 8950993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:33:58+00:00 2026-06-15T13:33:58+00:00

Assume I have an array employees1 : [ {id:1, name:Bill}, {id:2, name:Jhon}, {id:3, name:Almas},

  • 0

Assume I have an array employees1:

[
{"id":"1", "name":"Bill"},
{"id":"2", "name":"Jhon"},
{"id":"3", "name":"Almas"},
]

OR an Array employees2 with Employee objects:

@interface Employee : NSObject {
    NSNumber *employeeID;
    NSString *name;
}
@property (nonatomic, retain) NSNumber *employeeID;
@property (nonatomic, retain) NSString *name;

The second case is more Object Oriented which is easy to use in large projects.
If I have a lot of employees, will employee2 array allocate more (2x, 3x …) memory than employee1? How much they differ?

  • 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-15T13:34:00+00:00Added an answer on June 15, 2026 at 1:34 pm

    In most cases, likely lower memory footprint with the object-oriented model because you aren’t requiring the overhead of NSDictionary instances.

    However, you can (as I just did) write a trivial test case and run it on Instruments to prove it to yourself. In this case, I constructed such a test with your model, creating 10K objects and showed that your overall memory footprint was ~23% lower using custom objects.

    Always better to test, although honestly the object-oriented model is so much clearer that in the long run, a small difference in memory footprint even if it were a negative difference may be better.

    To editorialize: I see numerous questions here and elsewhere that pertain to the construction of the entire model layer of the application on NSDictionary and NSArray. I can’t imagine what a headache it would be to maintain that code in perpetuity. So much clearer using object-orientation.

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

Sidebar

Related Questions

Assume I have the following array: $array( '32' => array('name' => 'paul', 'age' =>
Lets assume I have a list of objects in an array and i want
Assume that I have an Array of objects in C#, and I want to
I have an array/list/collection/etc of objects. For sample purposes, lets assume it is just
Assume that I have two arrays as follow: $array1 = array(1, 3, 5); $array2
Assume that we have multiple arrays of integers. You can consider each array as
Assume I have two tables, Student Test Id Name TestId Type StudentId -- ----
Assume I have an array $arr. It's possible that it has an element with
I have an array of 1000-2000 elements which are pointers to objects. I want
Assuming I have an array of User objects where each object is actually one

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.