I don\'t entirely understand the details of how fast enumeration works, but compare the following two cases:
for(NSObject *object in self.myParent.parentsPar
That's probably compiler-specific (i.e. undefined). If you are that bothered then add some timing code and find out yourself:
#import
static unsigned getTickCount()
{
struct timeval tv;
gettimeofday(&tv, 0);
return (unsigned)((tv.tv_sec * 1000) + (tv.tv_usec / 1000));
}
...
unsigned startTime = getTickCount();
for(NSObject *object in self.myParent.parentsParents.granfathersMother.cousin.unclesNephew.array) {
// do something
}
unsigned endTime = getTickCount();
NSLog(@"That took %umS", endTime - startTime);
You will have to have a pretty big array however in order to register anything above 0
.