title: Merge NSMutableArray with a NSArray, filtering the duplicates
body: <p>I have two arrays, an NSMutableArray and an NSArray. The NSMutableArray is the "store", it stores results from a source of NSArrays. Every 5 minute, a new NSArray comes in and the data needs to be filtered and sorted.</p>
  
  <p>Sorting by date is pretty easy, so I managed to get the NSArray sorted by NSDate. Sorting the other array is not necessary, as it would only cause confusion with the user.</p>
  
  <p>What I want to do: the NSArray has a lot of different objects that all respond to -[object name], returning an NSString. The NSArray needs to be merged <strong>into</strong> the NSMutableArray, only adding <strong>new</strong> objects.</p>
  
  <p>The merging itself is no problem, but performance is. The NSMutableArray can contain up to 3000 items, and the NSArray can contain up to 250 items, although usually only 5 or 6 of these have to be merged into the NSMutableArray.</p>
  
  <p>So, my question is: how do you merge two arrays in Objective-C, filtering the duplicates, without iterating (250*3000) times?</p>
  
  <p>Tom</p>
  
  <p><strong>Edited to clarify something</strong><br>
  The "duplicate" objects are objects that are duplicate to the user but not to the code. They have the same name, but <strong>not</strong> the same address. </p>
  
  <p>More clarification: <code>@"value" != @"value" // true</code></p>