[SOLVED] Autocomplete from an array of dictionaries
[SOLVED] Autocomplete from an array of dictionaries
- Subject: [SOLVED] Autocomplete from an array of dictionaries
- From: Jason Wiggins <email@hidden>
- Date: Thu, 23 Oct 2008 19:14:37 +1100
Note to self: RTFM!
I was trying:
NSArray *matchingNames = [[namesArray objectForKey:@"description"]
filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"SELF
beginswith[cd] %@", substring]];
which doesn't work
What I wanted was:
NSArray *matchingNames = [[namesArray valueForKey:@"description"]
filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"SELF
beginswith[cd] %@", substring]];
Jason
On 23/10/2008, at 19:06 , Jason Wiggins wrote:
Hi,
I'm working on an autocompletion system such as with mail To: Cc:
fields etc.
I have an array of dictionaries and I want the autocomplete to match
to the key "description"
This code below works great for an array of strings:
NSArray *matchingNames = [namesArray filteredArrayUsingPredicate:
[NSPredicate predicateWithFormat:@"SELF beginswith[cd] %@",
substring]];
But how do I get the above code to match to a specific key from a
dictionary?
Regards,
Jason Wiggins
_______________________________________________
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