I’m new ios developer, I want to compare and change attributes
Array1 = (object1,object2, object3, object4)
Array2 = (object2,object4, object5, object8)
Compare Array1 and Array2
If same objects are in Array2, change attributes in the objects.
In this case above, Object2 and Object4 should be changed..
How should I do??
Please help me!!
You can use sets for this
You now have a set with just the objects which are in both arrays.
Now you can use
enumerateObjectsUsingBlock:on the set to manipulate the objects or convert the set back to an arrayNSArray *filteredArray = [array1Set allObjects]