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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:20:11+00:00 2026-05-18T08:20:11+00:00

I am facing the problem to insert the data into dictionary. It is not

  • 0

I am facing the problem to insert the data into dictionary.
It is not saving data in the order I had given to it.
For this dictionary I am giving one keys array and one values array like this.

both arrItemDetails and arrItemNames are NSMutableArray instances

NSArray *detailsArray = [NSArray arrayWithArray:arrItemDetails];

NSArray *namesArray = [NSArray arrayWithArray:arrItemNames];

NSDictionary *dictWithItemNamesAndDetails = [NSDictionary dictionaryWithObjects:arrItemDetails forKeys:arrItemNames];

But for my app I need to maintain order, so please help me regarding this.

I am giving outputs of namesArray (keys) and detailsArray (valuesarray) and after adding them how the dictionary is also kk

Printing description of arrItemDetails:

(
    hi,
    44,
    5,
    555,
    3
)

Printing description of arrItemNames:

(
    CardName,
    AccessNumber,
    AccessPause,
    Pin,
    Pause
)

Printing description of dictWithItemNamesAndDetails:

<CFBasicHash 0x6a90680 [0x274b380]>{type = immutable dict, count = 5,
entries =>
 0 : <CFString 0xe3b4 [0x274b380]>{contents = "AccessNumber"} = <CFString 0x6d25970 [0x274b380]>{contents = "44"}
 1 : <CFString 0xe394 [0x274b380]>{contents = "Pin"} = <CFString 0x6d3cda0 [0x274b380]>{contents = "555"}
 3 : <CFString 0xe384 [0x274b380]>{contents = "Pause"} = <CFString 0x6d37080 [0x274b380]>{contents = "3"}
 5 : <CFString 0xe3a4 [0x274b380]>{contents = "AccessPause"} = <CFString 0x6d6c250 [0x274b380]>{contents = "5"}
 6 : <CFString 0xe3c4 [0x274b380]>{contents = "CardName"} = <CFString 0x6d56c70 [0x274b380]>{contents = "hi"}
}

I want to store data in needed order. This is my main concern.

  • 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-18T08:20:12+00:00Added an answer on May 18, 2026 at 8:20 am

    A dictionary is not an ordered/indexed data structure. It is a key/value paired data structure. You can not guarantee the order of the keys. And after inserting new key/value the previous order might change. If you want to use dictionary, then you need to use keys to access the values, not any kind of index.

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

Sidebar

Related Questions

No related questions found

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.