fuzzygoat
fuzzygoat

Reputation: 26223

Where is [NSIndexPath row] documented?

Can anyone point me to where [indexPath row] is described in the documentation, I have looked at NSIndexPath but I can't find any mention of "row"? I am assuming its an NSUInteger, but I would also like to double check its type and see what other properties are available.

Example:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    NSUInteger currentRow = [indexPath row];
}

cheers Gary

Upvotes: 11

Views: 6005

Answers (3)

kennytm
kennytm

Reputation: 523634

The .row property is part of the extension category defined in UIKit.

The doc is in https://developer.apple.com/reference/foundation/nsindexpath/1614853-row (row) and https://developer.apple.com/reference/foundation/nsindexpath/1528298-section (section).

row

An index number identifying a row in a section of a table view. (read-only)

@property(readonly) NSUInteger row

Discussion

The section the row is in is identified by the value of section.


The Swift counterpart: https://developer.apple.com/reference/foundation/indexpath/1779554-row (row) and https://developer.apple.com/reference/foundation/indexpath/1779112-section (section).

These Swift properties are of type Int.

Upvotes: 21

jer
jer

Reputation: 20236

It's in the NSIndexPath(UITableView) documentation.

Upvotes: 3

BoltClock
BoltClock

Reputation: 724342

It's a UIKit addition, which is documented separately. You're correct in that it's an NSUInteger.

Upvotes: 1

Related Questions