- Why didn't the AppKit developers include this (the hasNext
method) in the first place?
NSEnumerator isn't in the AppKit.
- How do other developers conquer this problem?
If you need to know what the next object is going to be, then you
probably shouldn't use NSEnumerator. Instead, use an array iterator,
like this: (warning - code written in Mail, untested, use at your own
risk, etc.)
unsigned int i;
const unsigned int count = [array count];
for (i = 0 ; i < count ; i++)
{
id object = [array objectAtIndex:i];
// and so on, and so on...
if (i+1 < count)
{
// peek at the next object here
}
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden