NSOrderedCollectionDifference
An object representing the difference between two ordered collections.
Declaration
class NSOrderedCollectionDifferenceOverview
Use differenceFromArray: or one of its variations to get an instance of NSOrderedCollectionDifference, which represents the difference between two ordered collections.
For example, the following sample compares two arrays of strings to create a difference that represents the changes:
NSArray *original = @[@"Red", @"Green", @"Blue"];
NSArray *modified = @[@"Red", @"Blue", @"Green"];
NSOrderedCollectionDifference *diff = [original differenceFromArray:modified];
// diff.hasChanges == TRUE
// diff.insertions.count == 1
// diff.removals.count == 1
Topics
Accessing Changes
Inverting a Difference Object
Creating a Collection Difference Object
init(changes:)init(insert:insertedObjects:remove:removedObjects:)init(insert:insertedObjects:remove:removedObjects:additionalChanges:)