title: iOS Only add unique object to NSMutableOrderedSet
body: <p>I have an NSMutableOrderedSet. I download an array of "Person" objects. Each Person object has a unique id.</p>
  
  <p>What is the most efficient way to only add Person objects that are not already in the NSMutableOrderedSet?</p>
  
  <p>I can obviously iterate through the entire set and if the id does not exist at the end then add it - but that seems like the slowest way to do it.</p>
  
  <p>Ideas?</p>
  
  <p>What I am doing:</p>
  
  <pre><code>for (int x = 0; x &lt; existingSet.Count; x++)
  {
    if ([personA isEqualto: personB])
        break;
    if (x == existingSet.Count - 1 &amp;&amp; ![person isEqualto: personB])
        [existingSet addObject: personA];
  
  }
  </code></pre>