Iphone indexath的含义是什么?
我对iPhone开发还不熟悉。 我尝试操作tableview。 所以我看到了一些示例代码和书籍。 但是我不明白Iphone indexath的含义是什么?,iphone,Iphone,我对iPhone开发还不熟悉。 我尝试操作tableview。 所以我看到了一些示例代码和书籍。 但是我不明白indepath的含义是什么 下面是一行代码 - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath ; 请为我解释他indepath参数。它包含相关单元格的节号和行号。您可以编写indexPath.section和indexPath.row NSInd
indepath
的含义是什么
下面是一行代码
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath ;
请为我解释他
indepath
参数。它包含相关单元格的节号和行号。您可以编写indexPath.section
和indexPath.row
NSIndexPath类表示嵌套数组集合树中特定节点的路径
表有节和行,要知道行的位置,您需要知道它所在节的索引以及它在该节中的索引位置
UIKit
添加了一个类别,使使用UITableView
更容易
@interface NSIndexPath (UITableView)
+ (NSIndexPath *)indexPathForRow:(NSInteger)row inSection:(NSInteger)section;
@property(nonatomic,readonly) NSInteger section;
@property(nonatomic,readonly) NSInteger row;
@end