Re: matching single key/value pair to dictionary
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