I\'m new ios developer, I want to compare and change attributes
Array1 = (object1,object2, object3, object4) Array2 = (object2,object4, object5, object8)
Compare
You can use fast enumeration to pass through array 2, then use containsObject:
to check if it belongs to array1:
for (id object in array2)
{
if ([array1 containsObject:object])
{
// change your settings here
}
You could also create a new array using filteredArrayUsingPredicate:
, or get the index paths of the matching objects using indexesOfObjectsPassingTest:
. You haven't said how many objects are likely to be in your array so I don't know if performance is going to be an issue.