Instance Method


Returns an index path with the nodes in the receiving index path, excluding the last one.


- (NSIndexPath *)indexPathByRemovingLastIndex;

Return Value

A new index path with the receiving index path’s indexes, excluding the last one.


Returns an empty NSIndexPath instance if the receiving index path’s length is 1 or less.

Special Considerations

In OS X v10.4 this method returns nil when the length of the receiving index path is 1 or less. On iOS and macOS 10.5 and later this method never returns nil.

See Also

Adding and Removing Nodes

- indexPathByAddingIndex:

Returns an index path containing the nodes in the receiving index path plus another given index.