Fastest way to iterate through an NSArray with objects and keys
Posted
by AppGolfer
on Stack Overflow
See other posts from Stack Overflow
or by AppGolfer
Published on 2010-03-31T01:50:03Z
Indexed on
2010/03/31
1:53 UTC
Read the original article
Hit count: 365
Hello,
I have an NSArray called 'objects' below with arrayCount = 1000. It takes about 10 secs to iterate through this array. Does anyone have a faster method of iterating through this array?
Thanks!
for (int i = 0; i <= arrayCount; i++) {
event.latitude = [[[objects valueForKey:@"CLatitude"] objectAtIndex:i] floatValue];
event.longitude = [[[objects valueForKey:@"CLongitude"] objectAtIndex:i] floatValue];
}
© Stack Overflow or respective owner