I have 2 Nsarray where objects of 2 arrays are same may be indexes of the object differs, but it should print both are equal irrespective of there indexes
NSArra
Those two arrays are not equal. Two arrays are equal is they both have the same objects in the same order.
If you want to compare with no regard to order then you need to use two NSSet
objects.
NSSet *set1 = [NSSet setWithArray:arr1];
NSSet *set2 = [NSSet setWithArray:arr2];
if ([set1 isEqualToSet:set2]) {
// equal
}