• 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
NSDictionary fast search
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSDictionary fast search


  • Subject: NSDictionary fast search
  • From: Roberto Sobachi <email@hidden>
  • Date: Sat, 7 Feb 2004 12:13:53 +0100

Which is the fastest method to search a string value of an NSDictionary
in an NSArray?

I tried with this code, but with 500 or more elements in the array,
it's too slow:

for(i=0; i<[listArray count]; i++)
{
BOOL match = NO;

NSRange range = [[[listArray objectAtIndex:i] objectForKey:@"name"]
rangeOfString:@"jack" options:NSCaseInsensitiveSearch];

if (range.length != 0)
match = YES; //FIND STRING
}







Roberto Sobachi
developer
http://www.xidiar.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: NSDictionary fast search
      • From: Allan Odgaard <email@hidden>
  • Prev by Date: Re: are there any custom IB Palettes?
  • Next by Date: Subclassing NSTextStorage
  • Previous by thread: Re: Sending and receiving files to remote server through cocoa
  • Next by thread: Re: NSDictionary fast search
  • Index(es):
    • Date
    • Thread