• 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
[question] Checking for duplicate entries in NSMutableArray
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[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


  • Follow-Ups:
    • Re: [question] Checking for duplicate entries in NSMutableArray
      • From: Chris Suter <email@hidden>
    • Re: [question] Checking for duplicate entries in NSMutableArray
      • From: Guy English <email@hidden>
  • Prev by Date: Re: Running Shell Script from Cocoa Application
  • Next by Date: Control/Option keys both set "control" modifier flag in NSEvent
  • Previous by thread: Re: Running Shell Script from Cocoa Application
  • Next by thread: Re: [question] Checking for duplicate entries in NSMutableArray
  • Index(es):
    • Date
    • Thread