Re: count instances in an NSArray
Re: count instances in an NSArray
- Subject: Re: count instances in an NSArray
- From: Shaun Wexler <email@hidden>
- Date: Mon, 4 Oct 2004 18:04:10 -0700
On Oct 4, 2004, at 5:13 PM, Jonathan 'Wolf' Rentzsch wrote:
I'm missing a way count the number of instances (using isEqual:) in an
NSArray. Think containsObject:, except returning an unsigned instead
of a
BOOL. Sure I could easily code my own counter, but I think I'm missing
a
built-in way...
If efficiency doesn't matter:
UInt32 numberOfInstances = [[NSSet setWithArray:array] count];
HTH~
--
Shaun Wexler
MacFOH
http://www.macfoh.com
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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