开发者

Where is [NSIndexPath row] documented?

开发者 https://www.devze.com 2023-01-15 21:38 出处:网络
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,

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


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.


It's in the NSIndexPath(UITableView) documentation.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消