There are number of questions with similar title but none them of helped me.
but i can relate solution of this 'NSGenericException', reason: Collection <
You cannot delete items from a NSMutableArray while iterating it.
There are several solutions to this:
or
for loop instead of the for each syntax.Not copying the array saves you an allocation and a few CPU cycles:
for (int i = updatedLocalityArray.count-1 ; i >= 0 ; i--)
{
NSString *test = updatedLocalityArray[i];
if ([test isEqualToString:tableViewCell.textLabel.text])
{
[updatedLocalityArray removeObjectAtIndex:i];
NSLog(@"%@ *****", updatedLocalityArray);
}
}