NSDictionary fast search
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.