cocoa - When is NSEnumerator finished? -


How do we know when the calculation is finished? Docs says:

return value of

when all the objects have been calculated. I was hoping to implement some "representative-like" behavior under which ...

  if (nextObject == zero) {something because we did! }  

But I think there is no such thing:

  enumerationDidFinish:  

where in the lower block Can I check to complete the calculator?

  NSArray * anArray = // ...; NSEnumerator * Calculator = [anArray Object Enumerator]; Id object; {{Object = [calculator nextObject])} {// do something with the object ...}  

When while ends the loop, you know that the calculation is complete, you can then call the representative representative.


Comments