• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: CFArrayGetValueAtIndex
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >CFArrayGetValueAtIndex (From: Koen van der Drift <email@hidden>)

  • Prev by Date: Re: Full screen and popup menu
  • Next by Date: Re: Theft Recovery: Useful Tool or SpyWare?
  • Previous by thread: CFArrayGetValueAtIndex
  • Next by thread: applicationShouldOpenUntitledFile: activity causes AE-related crash?!?
  • Index(es):
    • Date
    • Thread