title: NSMutableArray check if object already exists
body: <p>I am not sure how to go about this. I have an <strong>NSMutableArray</strong> (addList) which holds all the items to be added to my datasource NSMutableArray. </p>
  
  <p>I now want to check if the object to be added from the addList array already exists in the datasource array. If it does not exist add the item, if exists ignore. </p>
  
  <p>Both the objects have a string variable called iName which i want to compare. </p>
  
  <p>Here is my code snippet</p>
  
  <pre><code>-(void)doneClicked{
      for (Item *item in addList){
          /*
          Here i want to loop through the datasource array 
          */
          for(Item *existingItem in appDelegate.list){
              if([existingItem.iName isEqualToString:item.iName]){
                  // Do not add
              }
              else{
                  [appDelegate insertItem:item];
              } 
          }
  }
  </code></pre>
  
  <p>But i find the item to be added even if it exists. </p>
  
  <p>What am i doing wrong ?</p>