2012-04-05 76 views
0

當我向上和向下滾動tableview時,我得到的tableview單元格沒有被選中。我應該如何在代碼中使用以下方法?iPhone中的tableview單元格選擇

[tableview selectRowAtIndexPath:animated:scrollPosition]; 
+0

有U試圖此消息中 - (空)的tableView:(UITableView的*) tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath ???把一些代碼..! – 2012-04-05 09:46:27

回答

1

我該如何在代碼中使用下面的方法?

[tableview selectRowAtIndexPath:animated:scrollPosition]; 

:添加一個新的細胞上的tableview和滾動表達增加細胞補充說:

NSArray *indexPaths = [NSArray arrayWithObjects: [NSIndexPath indexPathForRow:[self.yourDataSource count]-1 inSection:0],nil]; 
[self.myTableView beginUpdates]; 
[self.myTableView insertRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationTop]; 
[self.myTableView endUpdates]; 
[self.myTableView scrollToRowAtIndexPath:indexPaths atScrollPosition:UITableViewScrollPositionTop animated:YES]; 
相關問題