Removing objects in an NSArray one by one
Posted: Sat Jun 18, 2005 4:30 pm
My NSArray has 10 entries,
and for an exercise I am told to remove the entries one by one, what is the fastest method?
for (i=9; i < 0 & i< 10; i--) {[array removeObjectAtIndex:i];}
OR
while ([array count]>0){
[array removeLastObject];
}
PS: I am aware of removeAllObjects
and for an exercise I am told to remove the entries one by one, what is the fastest method?
for (i=9; i < 0 & i< 10; i--) {[array removeObjectAtIndex:i];}
OR
while ([array count]>0){
[array removeLastObject];
}
PS: I am aware of removeAllObjects