i am working on one app called duplicate image finder for IOS. my question is how to compare image array to find duplicate. suppose i have array of images and i want to find duplicate images from this array. how can i find it? any suggestions. i have used method that is convert image to data and compare data of image with each other that works perfectly in simulator but not working properly in device.
for (int i=0; i<arrImageData1.count; i++)
{
for (int j=i+1; j<arrImageData1.count; j++)
{
if ([[arrImageData1 objectAtIndex:i] length]==[[arrImageData2 objectAtIndex:j]length])
{
NSNumber *iValue = [NSNumber numberWithInt:i];
NSNumber *jValue = [NSNumber numberWithInt:j];
[arr addObject:iValue];
[arr addObject:jValue];
}
}
}
NSLog(@"%@",arr);
NSLog(@"%lu",(unsigned long)arr.count);
for (int k=0; k<arr.count; k++)
{
[arrDuplicateImages addObject:[arrImage objectAtIndex:[[arr objectAtIndex:k] integerValue]]];
}
}