Re: get a dictionary out of an array of dictionaries by a criterion
Re: get a dictionary out of an array of dictionaries by a criterion
- Subject: Re: get a dictionary out of an array of dictionaries by a criterion
- From: Dave DeLong <email@hidden>
- Date: Wed, 09 Mar 2011 09:44:50 -0800
Load the array into memory.
Create an NSPredicate with the predicateFormat: @"ID = %d", myID
Use filteredArrayUsingPredicate:
The resulting array contains the dictionaries you're looking for.
OR
Loop through the array and find it yourself.
Dave
On Mar 9, 2011, at 9:18 AM, Martin Batholdy wrote:
> Hi,
>
> I have a plist with an array of dictionaries.
> Now every of these dictionaries has a key 'ID' with an integer.
>
> Now how I can get only one dictionary element out of this array where key is equal to x?
>
>
> thanks for any advice!
_______________________________________________
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