• 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
Re: get a dictionary out of an array of dictionaries by a criterion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >get a dictionary out of an array of dictionaries by a criterion (From: Martin Batholdy <email@hidden>)

  • Prev by Date: get a dictionary out of an array of dictionaries by a criterion
  • Next by Date: Re: How to wait for methods with result/completion blocks to finish?
  • Previous by thread: get a dictionary out of an array of dictionaries by a criterion
  • Next by thread: Okay to talk about Xcode 4 now?
  • Index(es):
    • Date
    • Thread