That is the solution I use at the moment. I was only wondering if
someone maybe found a way to extend NSEnumerator with a new method
to peek which would make following code possible.
while(myObject = [enumerator nextObject]) {
do something (for example append a string)
if([enumerator hasNext]) {
do something (for example add a newline)
}
}
Something like the following might do the trick (composed entirely in
Mail, therefore probably not even remotely compilable):
@interface PeekingEnumerator : NSEnumerator
NSEnumerator *sourceEnumerator;
id peekedObject;
}
_______________________________________________
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