FROM : Steven Spencer
DATE : Fri Apr 22 10:58:17 2005
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_removed>>
>Subject: matching single key/value pair to dictionary
>To: <email_removed>
>Message-ID: <<email_removed>>
>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
DATE : Fri Apr 22 10:58:17 2005
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_removed>>
>Subject: matching single key/value pair to dictionary
>To: <email_removed>
>Message-ID: <<email_removed>>
>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
| Related mails | Author | Date |
|---|---|---|
| Sandeep Parikh | Apr 22, 00:54 | |
| Steven Spencer | Apr 22, 10:58 |






Cocoa mail archive

