Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to insert NSArrys into NSDictonary by without changing the order
    text
    copied!<p>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.</p> <p>both arrItemDetails and arrItemNames are NSMutableArray instances</p> <pre><code>NSArray *detailsArray = [NSArray arrayWithArray:arrItemDetails]; NSArray *namesArray = [NSArray arrayWithArray:arrItemNames]; NSDictionary *dictWithItemNamesAndDetails = [NSDictionary dictionaryWithObjects:arrItemDetails forKeys:arrItemNames]; </code></pre> <p>But for my app I need to maintain order, so please help me regarding this.</p> <p>I am giving outputs of namesArray (keys) and detailsArray (valuesarray) and after adding them how the dictionary is also kk</p> <p>Printing description of arrItemDetails:</p> <pre><code>( hi, 44, 5, 555, 3 ) </code></pre> <p>Printing description of arrItemNames:</p> <pre><code>( CardName, AccessNumber, AccessPause, Pin, Pause ) </code></pre> <p>Printing description of dictWithItemNamesAndDetails:</p> <pre><code>&lt;CFBasicHash 0x6a90680 [0x274b380]&gt;{type = immutable dict, count = 5, entries =&gt; 0 : &lt;CFString 0xe3b4 [0x274b380]&gt;{contents = "AccessNumber"} = &lt;CFString 0x6d25970 [0x274b380]&gt;{contents = "44"} 1 : &lt;CFString 0xe394 [0x274b380]&gt;{contents = "Pin"} = &lt;CFString 0x6d3cda0 [0x274b380]&gt;{contents = "555"} 3 : &lt;CFString 0xe384 [0x274b380]&gt;{contents = "Pause"} = &lt;CFString 0x6d37080 [0x274b380]&gt;{contents = "3"} 5 : &lt;CFString 0xe3a4 [0x274b380]&gt;{contents = "AccessPause"} = &lt;CFString 0x6d6c250 [0x274b380]&gt;{contents = "5"} 6 : &lt;CFString 0xe3c4 [0x274b380]&gt;{contents = "CardName"} = &lt;CFString 0x6d56c70 [0x274b380]&gt;{contents = "hi"} } </code></pre> <p>I want to store data in needed order. This is my main concern.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload