Remove Duplicates in a NSArray
site_archiver@lists.apple.com Delivered-To: cocoa-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=rEKhiAlyAKI8GjVQOKzcEgkD8MITl/4NVxzgmgInfnE=; b=BRAlOsMV6lC1+eo20PPAYvofN0qgFH1+K8fkIQo98MTkixfVTyZpSIgwc/4WZUB53B yO+CiefP45l0qVEr5rAeL5eggZsfA4XjHKj6EpcUclL0o21S81tH13GvtirVytK4Nt3u JeXkr8MmCKjCX/azSZP8wECVIWNSCV7l2vvCQ= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=VT2iF5JQ9gwhPKt4dT8Pj+Vv+wpNM5dxHhd5OBp3+Fb1cnqd6PUO1m1pPEI++vSOvL fD8WZyAGtSK49bOGEInG0eYQAxcQVSIsUnePXP+FQ8vtf9spIYIu+jinfRLSnGL0PjyD xrsgp44JolPGDbbNs3+pyP+OyHDMK6E5qC62E= 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:@ "testVal1",@"testKey",....,nil]; NSDictionary *dict3 = [NSDictionary dictionaryWithObjectsAndKeys:@ "testVal3",@"testKey",....,nil]; NSDictionary *dict4 = [NSDictionary dictionaryWithObjectsAndKeys:@ "testVal",@"testKey",....,nil]; NSArray *arrDicts = [NSArray arrayWithObjects:dict1,dict2,dict3,dict4,nil]; In the above code I want to remove the multiple dictionaries containing "testVal" and maintain only one dictionary containing "testVal" in the array "arrDict". -- Rashmi _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/site_archiver%40lists.apple... This email sent to site_archiver@lists.apple.com
participants (1)
-
Rashmi Vyshnavi