TableView scrollToRowAtIndexPath: animated: doesn't always scroll down
I'm having a strange issue in my tableview when I'm adding a lot of items in at a time. In my chat application I call scrollToRowAtIndexPath: every time a message comes in to bring the tableview to the bottom. When only 5 or so come in at a time this works perfectly, but if there's more (eg. 20+), for some reason the tableview only scrolls half way, forcing the user to scroll to the bottom themselves. Any ideas why and/ or开发者_开发百科 how to fix this?
Thank you.
NSInteger numberOfRows = [tableView numberOfRows];
if (numberOfRows > 0)
[tableView scrollRowToVisible:numberOfRows - 1];
精彩评论