ios - How i know the index of Array object in NSCountedSet -


this code getting duplicate device contacts , want know how index of duplicate contacts

nscountedset *set = [[nscountedset alloc] initwitharray:[contact valueforkey:@"emailaddress"]];  for(id name in set){     if([name isequal:[nsnull null]] || [name isequaltostring:@""]){      } else {         array=[[nsmutablearray alloc]init];         duplicateemaildictionary =[nsmutabledictionary new];         if ([set countforobject:name]>1) {             (int i=0; i<[set countforobject:name]; i++) {                 [array addobject:name];             }             [duplicateemaildictionary setobject:array forkey:@"emailaddress"];             [finalduplicateemail addobject:duplicateemaildictionary];         }     } } 

a set unordered pool of unique objects. since it's unordered, there no integer index can use access specific elements of set.

if need index use nsarray.


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - IE9 error '$'is not defined -