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

c# SetCompatibleTextRenderingDefault must be called before the first -

How to prevent logback from emitting repeated "Empty watch file list. Disabling" messages -

C#.NET Oracle.ManagedDataAccess ConfigSchema.xsd -