NSEnumerator doesn't support NSCopying - why?
NSEnumerator doesn't support NSCopying - why?
- Subject: NSEnumerator doesn't support NSCopying - why?
- From: Wade Tregaskis <email@hidden>
- Date: Tue, 10 Feb 2004 21:09:54 +1100
I'm trying to iterate through an array in the following way:
outerEnumerator = [objects objectEnumerator];
while (a = [outerEnumerator nextObject]) {
innerEnumerator = [outerEnumerator copy];
while (b = [innerEnumerator nextObject]) {
// do stuff here
}
}
Now, that'd be fantastic if NSEnumerator supported NSCopying. As is it
raises an NSInvalidArgumentException (originating in copyWithZone:).
I'm hesitant to revert to indexing into the array, since I would hope
that using an enumerator would be faster.
Anyone know why an NSEnumerator (NSIdEnumerator, in this particular
case) can't be copied, and some way to get around this, aside from the
obvious i,j loop?
Wade Tregaskis
-- Sed quis custodiet ipsos custodes?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.