Re: CFArrayGetValueAtIndex
Re: CFArrayGetValueAtIndex
- Subject: Re: CFArrayGetValueAtIndex
- From: Nick Zitzmann <email@hidden>
- Date: Thu, 23 Sep 2004 18:34:10 -0600
On Sep 23, 2004, at 6:27 PM, Koen van der Drift wrote:
I am using this to iterate through an NSArray:
for ( i = 0; i < [array count]; i++ )
{
aSymbol = (Symbol *)CFArrayGetValueAtIndex( (CFArrayRef) array, i);
...
}
Is there something similar to use with an NSCountedSet?
Sets don't have any order, so you can't iterate through it like that.
However, you can use an enumerator to iterate through it, like this:
(warning - written in Mail, untested, use at your own risk, and all
that)
NSEnumerator *e = [countedSet objectEnumerator];
Symbol *aSymbol;
while (aSymbol = [enum nextObject])
{
// do your work on aSymbol here
}
Take a look at the NSSet and NSCountedSet documentation for more
details.
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden