Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios5 导航回UITableView时更改NSIndexPath_Ios5_Uitableview_Nsindexpath - Fatal编程技术网

Ios5 导航回UITableView时更改NSIndexPath

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

场景(iOS 5)
我目前有一个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];