I am trying to compare two mutable arrays having my model objects. In one array I am creating the model objects as-is, where as in the other array I am creating a copy of the original object using copyWithZone (My models are subclass of NSObject). However when I compare, It is always failing even though I did not change anything.
I printed both the arrays just to check and both seem to have the same objects.
Will isEqualToArray not work on copied items?
Can someone point out where I am going wrong? Or if there is any other way to do this comparison?
When comparison involved between object, then
isEqualandhashmethods should be overridden. isEqualToArray will return true only if object passisEqualtest. So please implementisEqualandhashmethods in your modal object. After that you will able to useisEqualToArraymethod.