 <p>This code:</p> <pre><code>for(NSString *jidAct in occupantsArray){ if([jidAct isEqualToString:jid]){ [occupantsArray removeObjectAtIndex:i]; } i++; } </code></pre> <p>is probably causing your problems. You shouldn't be removing elements while enumerating the array. The way you avoid this is by using an NSMutableIndexSet:</p> <pre><code>NSMutableIndexSet *indexes = [NSMutableIndexSet set]; // assuming NSInteger i; for(NSString *jidAct in occupantsArray){ if([jidAct isEqualToString:jid]){ [indexes addIndex:i]; } i++; } [occupantsArray removeObjectsAtIndexes:indexes]; </code></pre>