我有一個聊天應用程序,其中我想在新的聊天數據到來時將索引路徑增加一個。但它不是通過我的代碼發生我與屏幕快照分享代碼請幫助。在TableView(iOS)中將索引路徑移動一個
NSUInteger messageCount = [self numberOfMessages];
if (self.conversation && messageCount > 0) {
NSLog(@"%ld",(long)indexPathValue.row);
NSIndexPath* ip = [NSIndexPath indexPathForRow:indexPathValue.row + 1 inSection:0];
NSLog(@"%ld",(long)ip.row);
[layerChatTableView scrollToRowAtIndexPath:ip atScrollPosition:UITableViewScrollPositionTop animated:YES];
}
我認爲你需要的是滾動tableview到底部。此鏈接可能會幫助你http://stackoverflow.com/questions/2770158/how-to-scroll-to-the-bottom-of-a-uitableview-on-the-iphone-before-the-view-appea – Tien