Ios5 导航回UITableView时更改NSIndexPath
场景(iOS 5)Ios5 导航回UITableView时更改NSIndexPath,ios5,uitableview,nsindexpath,Ios5,Uitableview,Nsindexpath,场景(iOS 5) 我目前有一个UITableView。 它有30个表行 用户决定单击第5行 已按下ViewController。 在此ViewController中,用户向前导航了10个项目。 当它们导航回UITableView时,它们在第5行高亮显示 我想要什么 我希望UITableView在视图中突出显示表的第15行,因为它们在ViewController中向前移动了10行 我的发现 我想我可以在返回时将nsindepath行属性修改为15。但是Documentation声明它是只读的 r
我目前有一个UITableView。
它有30个表行
用户决定单击第5行
已按下ViewController。
在此ViewController中,用户向前导航了10个项目。
当它们导航回UITableView时,它们在第5行高亮显示 我想要什么
我希望UITableView在视图中突出显示表的第15行,因为它们在ViewController中向前移动了10行 我的发现
我想我可以在返回时将nsindepath行属性修改为15。但是Documentation声明它是只读的
row
An index number identifying a row in a section of a table view. (read-only)
@property(readonly) NSInteger row
Discussion
The section the row is in is identified by the value of section.
有没有关于如何解决此问题的反馈?如果您只想更改选择,请使用此
UITableView
方法:
- (void)
selectRowAtIndexPath:(NSIndexPath*)indexPath
animated:(BOOL)animated
scrollPosition:(UITableViewScrollPosition)scrollPosition;
您不需要修改特定的索引路径来调用该API,只需创建一个新的;例如:
NSIndexPath* indexPath = [NSIndexPath indexPathForRow:row inSection:section];