[question] Checking for duplicate entries in NSMutableArray
[question] Checking for duplicate entries in NSMutableArray
- Subject: [question] Checking for duplicate entries in NSMutableArray
- From: email@hidden
- Date: Sun, 7 Oct 2007 02:51:13 +0200
Hi *,
what would be an efficient and smart way to check for duplicate
entries in an NSMutableArray? The objects of this array are of a
class, that has only a bunch of strings as variables (i.e. firstName,
lastName, memberOfGroup...).
I've read about using NSDictionary when no duplicates are wanted at
all, however, my case lies differently: duplicates must be allowed
but should be affirmed by the user, namely in the case, that there
actually is someone of the same name in the same group...yet...still
another person.
So i need a way to quickly and efficiently check the entire Array for
an object which values are identical to the ones that just were
entered. My thoughts were drifting into some sort of *creating a hash
over the strings and store that in an additional NSString
variable*...but i'm not sure if that's really efficient (checking the
entire Array for String comparisons upon the creation (--> insertion)
of a new object) and also i wouldn't be sure how to go about that).
As always, i appreciate any feedback and have nothing but <3 for this
list!
Gute Nacht aus Berlin,
Malte Philipp A.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden