How do we know when enumeration is finished? The docs say: the return value of
nextObject
is nil when all objects have been enumerated. I was hoping to implement some "delegate-like" behavior whereby ...
if (nextObject == nil) {
do something because we're done!
}
But I see there is no such thing as:
enumerationDidFinish:
where in the following block could I check for the enumerator to be complete?
NSArray *anArray = // ... ;
NSEnumerator *enumerator = [anArray objectEnumerator];
id object;
while ((object = [enumerator nextObject])) {
// do something with object...
}