Error:

Add object to the mutable array

[mutableArray addObject:@"One"];

Add multiple objects to the mutable array

[mutableArray addObjects:[NSArray arrayWithObjects:@"One", @"Two", @"Three", nil]];

Insert object into the mutable array at given index

// prepend array with string "One"
[mutableArray insertObject:@"One" atIndex:0];

Insert multiple objects into the mutable array at given indexes

NSMutableIndexSet *set = [NSMutableIndexSet indexSetWithIndex:3];
[set addIndex:1];
NSMutableArray *array = [NSMutableArray arrayWithObjects:@"One", @"Two", @"Three", nil];
[array insertObjects:[NSArray arrayWithObjects:@"a", @"b", nil] atIndexes:set];
// array contains ("One", "a", "Two", "b", "Three")

Remove all objects from the mutable array

[mutableArray removeAllObjects];

Remove last object from the mutable array

[mutableArray removeLastObject];

Remove all occurrences of the value from the mutable array

[mutableArray removeObject:obj];

Remove all occurrences of the value in given range from the mutable array

[mutableArray removeObject:obj inRange:NSMakeIndex(10, 5)];

Remove object at given index from the mutable array

[mutableArray removeObjectAtIndex:0];

Remove object at given indexes from the mutable array

NSMutableIndexSet *set = [NSMutableIndexSet indexSetWithIndex:3];
[set addIndex:1];
[mutableArray removeObjectsAtIndexes:set];

Remove all occurrences of the object from the mutable array

// removes objects with the same address
[mutableArray removeObjectIdenticalTo:obj];

Remove all occurrences of the object in given range from the mutable array

// removes objects with the same address
[mutableArray removeObjectIdenticalTo:obj inRange:NSMakeIndex(10, 5)];

Remove multiple objects from the mutable array

[mutableArray removeObjectsInArray:[NSArray arrayWithObjects:@"One", @"Two", @"Three", nil]];

Remove chunk of the mutable array

// Remove first 10 objects
[mutableArray removeObjectsInRange:NSMakeRange(0, 10)];

Replace object in the mutable array

// replace first object
[mutableArray replaceObjectAtIndex:0 withObject:@"First"];

Replace multiple objects in the mutable array

NSMutableIndexSet *set = [NSMutableIndexSet indexSetWithIndex:2];
[set addIndex:0];
NSMutableArray *array = [NSMutableArray arrayWithObjects:@"One", @"Two", @"Three", nil];
[array replaceObjectsAtIndexes:set withObjects:[NSArray arrayWithObjects:@"a", @"b", nil]];
// array contains ("a", "Two", "b")

Replace chunk of the mutable array with another array

// replace first 10 objects with anotherArray
[mutableArray replaceObjectsInRange:NSMakeRange(0, 10) withObjectsFromArray:anotherArray];

Replace chunk of the mutable array with the chunk of another array

// replace first 10 objects with first 3 objects of anotherArray
[mutableArray replaceObjectsInRange:NSMakeRange(0, 10) withObjectsFromArray:anotherArray range:NSMakeRange(0, 3)];

Filter objects of the mutable array using predicate

NSMutableArray *people;
// people contains objects with NSString property "city"
NSPredicate *cityPredicate = [NSPredicate predicateWithFormat:@"city = 'Vancouver'"];
[people filterSetUsingPredicate:cityPredicate];
// now people contains only people from Vancouver

Swap two objects in the mutableArray

[mutableArray exchangeObjectAtIndex:0 withObjectAtIndex:5];

Sort the mutable array using descriptor

NSArray *descriptors = [NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"relevance" ascending:YES]];
// objects in array should be KVC-compliant
[mutableArray sortedArrayUsingDescriptors:descriptors];

Sort the mutable array using comparator

[mutableArray sortUsingComparator:^(id obj1, id obj2) {
    if ([obj1 relevance] > [obj2 relevance]) {
        return (NSComparisonResult)NSOrderedDescending;
    }

    if ([obj1 relevance] < [obj2 relevance]) {
        return (NSComparisonResult)NSOrderedAscending;
    }

    return (NSComparisonResult)NSOrderedSame;
}];

Sort the mutable array using function

NSInteger relevanceSort(id result1, id result2, void *context)
{
    int r1 = [result1 relevance];
    int r2 = [result2 relevance];

    if (r1 < r2)
        return NSOrderedAscending;
    else if (r1 > r2)
        return NSOrderedDescending;
    else
        return NSOrderedSame;
}

[mutableArray sortUsingFunction:relevanceSort context:NULL];

Sort the mutable array using selector

[mutableArray sortedUsingSelector:@selector(caseInsensitiveCompare:)];