我有一個很多值的tableView。如何獲取當前顯示的tableView的indexPath.row?
我想獲得當前正在顯示的表格的第一個indexPath.row
值。
我該怎麼做?
我獲得以下錯誤,同時實施krishnabhadra的回答是:在該錯誤出現是
線:
[self.table scrollToRowAtIndexPath:indexVis atScrollPosition:UITableViewScrollPositionTop animated:YES];
錯誤:
Assertion failure in -[NSIndexPath row], /SourceCache/UIKit_Sim/UIKit-1447.6.4/UITableViewSupport.m:2018
2011-04-01 11:57:25.458 GlossaryPro[1525:207] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid index path for use with UITableView. Index paths passed to table view must contain exactly two indices specifying the section and row. Please use the category on NSIndexPath in UITableView.h if possible.'
出了什麼問題?
當前正在顯示或當前由用戶選擇? – Krishnabhadra 2011-04-01 05:43:08
我問過,除非你的單元太大以至於它覆蓋了整個屏幕,在那裏顯示的多個單元格當前正在顯示 – Krishnabhadra 2011-04-01 05:44:12
。 – 2011-04-01 05:44:25