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

sql - can we replace full join with union of left and right join? why not? -

javascript - Parallax scrolling and fixed footer code causing width issues -

iOS: Performance of reloading UIImage(name:...) -