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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:39:57+00:00 2026-06-11T12:39:57+00:00

in Objective C – what is the difference between dictionaries and arrays? Are dictionaries

  • 0

in Objective C – what is the difference between dictionaries and arrays? Are dictionaries used with key : value (where Key can be any object), and arrays are id : value (where id is an integer)?

thanks

  • 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-11T12:39:59+00:00Added an answer on June 11, 2026 at 12:39 pm

    Array

    In Objective-C, an array is a type of collection which can store object types. It can store any type of objects. Objects stored in an array are linked to their index number.

    eg. if you create an array and insert the first object, it will be stored in “index 0”
    and, the index number will keep on increasing from 0,1,2….n

    Use “NSMutableArray” to create an array that can be modified.

    example,

    NSMutableArray *array = [NSMutableArray alloc] init];
    [array addObject:@"Tom"];
    [array addObject:@"Cat"];
    

    So, at index 0, you will have “Tom”. And, at index 1, you will have “Cat”.

    Dictionary

    In Objective-C, a dictionary is a type of collection that stores “key-value” pairs.
    The “key” is of type ID, so you can enter any object as key for a value.

    Use “NSMutableDictionary” to create a dictionary that can be modified.

    example,

    NSMutableDictionary *dictionary = [NSMutableDictionary alloc] init];
    [dictionary setObject:@"Tom" forkey:@"name"];
    [dictionary setObject:@"Cat" forKey:@"animal"];
    

    The key difference between array and dictionary is the sequence of the objects gets changed in a dictionary, while in an array the sequence of objects stored is SEQUENTIAL.

    [EDIT]

    Since there has been quite a discussion with regard to this answer, I will make it clear that the array does NOT get re-created as some comments say.

    The size of array/dictionary gets dynamically increased to accomodate the new elements in the colletion.

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

Sidebar

Related Questions

In objective-c whats the difference between using a . and using ->? I've used
Objective: To prevent users from tampering any id (example: CustomerId, UserId, ProductId, etc) between
Objective-C uses a sophisticated message-passing system when one object calls a method on another
Objective C is new for me. How can I change the font of a
Using Objective-C, how can I give/take the permissions for all user to read a
In Objective-C, I've used Three20's TTUrlRequest to enable some simple caching of my web
In Objective-C I have a timer fire every 0.1 seconds and increment a double value
Objective-C is a language like Smalltalk, but weakly, dynamically typed language. And I can
Objective C docs from apple says For the object-oriented constructs of Objective-C, such as
(Objective C) Just using simple AudioServicesPlaySystemSoundID and its counterparts, but I can't find in

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.