在哪里记录了[NSIndexPath行]?

fuz*_*oat 11 iphone cocoa-touch objective-c

任何人都可以指出我在文档中描述[indexPath行]的位置,我看过NSIndexPath但我找不到任何提及"行"的内容?我假设它是一个NSUInteger,但我还想仔细检查它的类型,看看有哪些其他属性可用.

例:

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

欢呼加里

ken*_*ytm 21

.row属性是UIKit中定义的扩展类别的一部分.

该文档位于https://developer.apple.com/reference/foundation/nsindexpath/1614853-row(行)和https://developer.apple.com/reference/foundation/nsindexpath/1528298-section(部分).

标识表视图的一部分中的行的索引号.(只读)

@property(readonly) NSUInteger row
Run Code Online (Sandbox Code Playgroud)

讨论

行所在的部分由值的值标识section.


Swift对应方:https://developer.apple.com/reference/foundation/indexpath/1779554-row(row)和https://developer.apple.com/reference/foundation/indexpath/1779112-section(section).

这些Swift属性属于类型Int.