• 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: matching single key/value pair to dictionary
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: matching single key/value pair to dictionary


  • Subject: Re: matching single key/value pair to dictionary
  • From: Steven Spencer <email@hidden>
  • Date: Fri, 22 Apr 2005 09:58:17 +0100

Try this (typed in email)

NSMutableArray *arr = [NSArray array];
NSEnumerator *enm = [myMutableArray objectEnumerator];
NSMutableDictionary *dc;

while (dc = [enm nextObject]) {
  if ([[dc objectForKey:myKey] isEqual:myValue])
    [arr addObject:dc];
}

[myMutableArray removeObjectsInArray:arr];


  - Steve


>Message: 7
>Date: Thu, 21 Apr 2005 17:54:18 -0500
>From: Sandeep Parikh <email@hidden>
>Subject: matching single key/value pair to dictionary
>To: email@hidden
>Message-ID: <email@hidden>
>Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
>
>I've got an NSMutableArray wherein every object is an
>NSMutableDictionary.  I would like to remove any NSMutableDictionary
>that contains (among other things) a given single key/value pair.
>
>Is there an existing class/method that will let me accomplish this?
>I looked into using NSArray's makeObjectsPerformSelector but it
>didn't seem to fit my needs exactly.
>
>thanks!
>-Sandeep

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Memory management with nibs
  • Next by Date: Objective-C++ and overloading and inheritance of static member functions
  • Previous by thread: matching single key/value pair to dictionary
  • Next by thread: RE: NSTextView and layout manager or cells - how to be most efficient?
  • Index(es):
    • Date
    • Thread