title: replaceObjectAtIndex nsmutableArray
body: <p>EDIT: this is my full code:</p>
  
  <p>i have a array how look like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
  &lt;plist version="1.0"&gt;
  &lt;array&gt;
      &lt;dict&gt;
          &lt;key&gt;destinataire&lt;/key&gt;
          &lt;string&gt;david&lt;/string&gt;
          &lt;key&gt;expediteur&lt;/key&gt;
          &lt;string&gt;sophie&lt;/string&gt;
          &lt;key&gt;idMessage&lt;/key&gt;
          &lt;string&gt;1729&lt;/string&gt;
          &lt;key&gt;message&lt;/key&gt;
          &lt;string&gt;ok a plus&lt;/string&gt;
          &lt;key&gt;photoExp&lt;/key&gt;
          &lt;string&gt;http://photos/hbrJUlrTgj.jpg&lt;/string&gt;
          &lt;key&gt;statusE&lt;/key&gt;
          &lt;string&gt;1&lt;/string&gt;
      &lt;/dict&gt;
      &lt;dict&gt;
          &lt;key&gt;destinataire&lt;/key&gt;
          &lt;string&gt;david&lt;/string&gt;
          &lt;key&gt;expediteur&lt;/key&gt;
          &lt;string&gt;max&lt;/string&gt;
          &lt;key&gt;idMessage&lt;/key&gt;
          &lt;string&gt;1730&lt;/string&gt;
          &lt;key&gt;message&lt;/key&gt;
          &lt;string&gt;ok a plus&lt;/string&gt;
          &lt;key&gt;photoExp&lt;/key&gt;
          &lt;string&gt;http:///photos/4xlWoAHT8b.jpg&lt;/string&gt;
          &lt;key&gt;statusE&lt;/key&gt;
          &lt;string&gt;1&lt;/string&gt;
      &lt;/dict&gt;
      &lt;dict&gt;
          &lt;key&gt;destinataire&lt;/key&gt;
          &lt;string&gt;david&lt;/string&gt;
          &lt;key&gt;expediteur&lt;/key&gt;
          &lt;string&gt;michel&lt;/string&gt;
          &lt;key&gt;idMessage&lt;/key&gt;
          &lt;string&gt;1731&lt;/string&gt;
          &lt;key&gt;message&lt;/key&gt;
          &lt;string&gt;ok a plus&lt;/string&gt;
          &lt;key&gt;photoExp&lt;/key&gt;
          &lt;string&gt;http:///photos/TR7oO6O8Z8.jpg&lt;/string&gt;
          &lt;key&gt;statusE&lt;/key&gt;
          &lt;string&gt;1&lt;/string&gt;
      &lt;/dict&gt;
  &lt;/array&gt;
  &lt;/plist&gt;
  </code></pre>
  
  <p>i need to put new datas in this array but in my new data i have this :</p>
  
  <pre><code>&lt;dict&gt;
              &lt;key&gt;destinataire&lt;/key&gt;
              &lt;string&gt;david&lt;/string&gt;
              &lt;key&gt;expediteur&lt;/key&gt;
              &lt;string&gt;sophie&lt;/string&gt;
              &lt;key&gt;idMessage&lt;/key&gt;
              &lt;string&gt;1729&lt;/string&gt;
              &lt;key&gt;message&lt;/key&gt;
              &lt;string&gt;ok a plus&lt;/string&gt;
              &lt;key&gt;photoExp&lt;/key&gt;
              &lt;string&gt;http://photos/hbrJUlrTgj.jpg&lt;/string&gt;
              &lt;key&gt;statusE&lt;/key&gt;
              &lt;string&gt;1&lt;/string&gt;
          &lt;/dict&gt;
  </code></pre>
  
  <p>sophie is already exist in my array so i have to find the index in my array where sophie appears to put my new data</p>
  
  <p>so i do this to try to find duplicates datas and replace it</p>
  
  <pre><code>if ([[allMessageArray valueForKey:@"expediteur"]containsObject:[dicoChat2 objectForKey:@"expediteur"]] ) 
      {
      for( int i=0;i&lt;[allMessageArray count];i++)
        {
      NSDictionary *dicoChat22 = [allMessageArray objectAtIndex:i];
  
      NSMutableDictionary *  datas2= [[NSMutableDictionary alloc]init];
  
      [datas2 setObject:[dicoChat22 objectForKey:@"destinataire"] forKey:@"destinataire"];
      [datas2 setObject:[dicoChat22 objectForKey:@"expediteur"] forKey:@"expediteur"];
      [datas2 setObject:[dicoChat22 objectForKey:@"photoExp"] forKey:@"photoExp"];
      [datas2 setObject:[dicoChat22 objectForKey:@"statusE"] forKey:@"statusE"];
      [datas2 setObject:[dicoChat22 objectForKey:@"idMessage"] forKey:@"idMessage"];
  
      [allMessageArray replaceObjectAtIndex:i withObject:datas2];
      [allMessageArray writeToFile:datAllString atomically:YES];
       }
  
      }
  </code></pre>
  
  <p>when i try to use replaceObjectAtindex:i it works but all my datas has been replaced in every index. 
  so i know i didn't find the good index 
  how i can found it?</p>
  
  <p>thx</p>