title: Unable to sort NSMutableDictionary [Objective C]
body: <p>I populate an <code>NSMutableDictionary</code> with some Json, the problem is that even if the Json is ordered correctly the <code>NSMutableDictionary</code> reorder the values randomly (at least I don't know what's the logic behind it).</p>
  
  <p>I tried to reorder the <code>NSMutableDictionary</code> using the following method but I still get the same result as the Json:</p>
  
  <pre><code>NSArray* sortedKeys = [theData allKeys];
  NSMutableArray* orderHelper = [[NSMutableArray alloc] initWithArray:sortedKeys];
  [orderHelper sortUsingComparator:^NSComparisonResult(NSString *str1, NSString *str2) {
      return [str1 compare:str2 options:(NSNumericSearch)];
  }];
  
  NSMutableDictionary *sortedDictionary = [[NSMutableDictionary alloc] init];
  
  for (NSString *key in orderHelper){
      [sortedDictionary setObject:theData[key] forKey:key];
  }
  </code></pre>
  
  <p>where <code>theData</code> is the first <code>NSMutableDictionary</code> containing the Json.</p>
  
  <p>debugging I can see that the <code>NSMutableArray</code> gets ordered correctly but then on the for the <code>NSMutableArray</code> randomly reorders the items.
  Does anyone have a solution for this?</p>