Type Method

indexPathForItem:inSection:

Initializes an index path with the indexes of a specific item and section in a collection view.

Declaration

iOS, Mac Catalyst, tvOS
+ (instancetype)indexPathForItem:(NSInteger)item inSection:(NSInteger)section;
macOS
+ (NSIndexPath *)indexPathForItem:(NSInteger)item inSection:(NSInteger)section;

Parameters

item

An index number identifying an item in a UICollectionView object in a section identified by the section parameter.

section

An index number identifying a section in a UICollectionView object.

Return Value

An NSIndexPath object.

See Also

Using Special Node Names

+ indexPathForRow:inSection:

Initializes an index path with the indexes of a specific row and section in a table view.

section

An index number identifying a section in a table view or collection view.

row

An index number identifying a row in a section of a table view.

item

An index number identifying an item in a section of a collection view.