i have some problem with two ways of iteration.
NSArray *array=[[NSArray alloc] initWithObjects:@"A",@"B",@"C",@"D",nil];
NSMutableArray *mutArray=[[NSMutableArray alloc] initWithArray:array];
when i do like this then it's working correct
for (int i=0;[mutArray count]!=0;) {
[mutArray removeObjectAtIndex:i];
}
NSLog(@"%d,",[mutArray count]);
But when i do like this, it's crashing... why?
for(id obj in mutArray)
{
[mutArray removeObject:obj]
}
NSLog(@"%d,",[mutArray count]);
Please give me the solution for second case.