title: Merge two arrays while preserving the original array order
body: <p>I've writing an application that requests data from an external source (Twitter), which is returned as an ordered array in chronological order:</p>
  
  <p><strong>External array</strong></p>
  
  <ol>
  <li>Item A (Latest)</li>
  <li>Item B</li>
  <li>Item C</li>
  <li>Item D (Oldest)</li>
  </ol>
  
  <p>I add these items to another array preserving the same order:</p>
  
  <p><strong>My array</strong></p>
  
  <ol>
  <li>Item A (Latest)</li>
  <li>Item B</li>
  <li>Item C</li>
  <li>Item D (Oldest)</li>
  </ol>
  
  <p>I then query the external source again and receive another array of new items, it looks like this:</p>
  
  <p><strong>New External array</strong></p>
  
  <ol>
  <li>Item E (Latest)</li>
  <li>Item F</li>
  <li>Item G</li>
  <li>Item H</li>
  </ol>
  
  <p>I add them to my array and get this:</p>
  
  <p><strong>My array</strong></p>
  
  <ol>
  <li>Item A</li>
  <li>Item B</li>
  <li>Item C</li>
  <li>Item D (Oldest)</li>
  <li>Item E (Latest)</li>
  <li>Item F</li>
  <li>Item G</li>
  <li>Item H</li>
  </ol>
  
  <p>The problem is that the external array data is sorted chronologically with the newest item first originally that was A, since doing an update that is now E. So you can see the ordering of the array is now wrong, what I need is:</p>
  
  <p><strong>My array</strong></p>
  
  <ol>
  <li>Item E (Latest)</li>
  <li>Item F</li>
  <li>Item G</li>
  <li>Item H</li>
  <li>Item A</li>
  <li>Item B</li>
  <li>Item C</li>
  <li>Item D (Oldest)</li>
  </ol>
  
  <p>My code currently looks something like this:</p>
  
  <pre><code>NSMutableArray *myArray = [[NSMutableArray alloc] init]; 
  ...
  - (void)getDataFromExternalSource:(NSArray *)externalArray
  {
  for(NSDictionary *item in externalArray) {
  
      // Need loop so I can do some extra stuff here with each item object (not shown in this example.)
      [myArray addObject: item];
  }   
  }
  </code></pre>