Re: Remove Duplicates in a NSArray

2011-04-10 Thread Christopher Nagel
Could you just add each dictionary to a single dict and then have a globally unique set of keys? This would presuppose you know which value of testKey is the one you wan to retain, and you'd add that one last. Chris On Oct 1, 2008, at 7:29 AM, Rashmi Vyshnavi wrote: Hi All, Is there a

Re: Remove Duplicates in a NSArray

2011-04-10 Thread Matt Neuburg
On Sun, 10 Apr 2011 12:42:50 -0400, Christopher Nagel ch...@cnagel.com said: Could you just add each dictionary to a single dict and then have a globally unique set of keys? This would presuppose you know which value of testKey is the one you wan to retain, and you'd add that one last. On

Re: Remove Duplicates in a NSArray

2008-10-03 Thread Uli Kusterer
On 01.10.2008, at 13:29, Rashmi Vyshnavi wrote: Is there a way to remove dictionary item containing same values for a key from a array of dictionaries? If you used an NSSet instead of an NSArray, you might get this automatically. Not sure whether the objects really have to be the same,

Remove Duplicates in a NSArray

2008-10-01 Thread Rashmi Vyshnavi
Hi All, Is there a way to remove dictionary item containing same values for a key from a array of dictionaries? E.g. NSDictionary *dict1 = [NSDictionary dictionaryWithObjectsAndKeys:@ testVal,@testKey,,nil]; NSDictionary *dict2 = [NSDictionary dictionaryWithObjectsAndKeys:@

Re: Remove Duplicates in a NSArray

2008-10-01 Thread Andre Masse
Hi, NSArray and NSDictionary are one shot objects. Once you've created them, they're read-only. You need to use the mutable version for adding/removing objects inside a collection. See NSMutableDictionary, NSMutableArray etc. Andre Masse On Oct 1, 2008, at 07:29, Rashmi Vyshnavi

Re: Remove Duplicates in a NSArray

2008-10-01 Thread Ken Thomases
On Oct 1, 2008, at 6:29 AM, Rashmi Vyshnavi wrote: Is there a way to remove dictionary item containing same values for a key from a array of dictionaries? E.g. NSDictionary *dict1 = [NSDictionary dictionaryWithObjectsAndKeys:@ testVal,@testKey,,nil]; NSDictionary *dict2 =