Contents

differenceFromArray:withOptions:usingEquivalenceTest:

Compares two arrays, using the provided block and with options, to create a difference object that represents the changes between them.

Declaration

- (NSOrderedCollectionDifference<id> *) differenceFromArray:(NSArray<id> *) other withOptions:(NSOrderedCollectionDifferenceCalculationOptions) options usingEquivalenceTest:(BOOL (^)(ObjectType obj1, ObjectType obj2)) block;

Discussion

The options allow you to choose to omit insertion or removal references to the change objects within the difference object’s changes. Don’t use the option inferMoves when providing a block for the equivalence test. The changes returned in the difference object don’t include valid values for associatedIndex.

See Also

Comparing with Another Array