使用以下代码将表格视图滚动至底部
Objective-C:
NSIndexPath* indexPath = [NSIndexPath indexPathForRow: [tableView numberOfRowsInSection: [tableView numberOfSections]-1]-1 inSection: [tableView numberOfSections]-1];
[tableView scrollToRowAtIndexPath: indexPath atScrollPosition: UITableViewScrollPositionBottom animated: YES];
Swift:
let indexPath = IndexPath(row: tableView.numberOfRows(inSection: tableView.numberOfSections-1)-1, section: tableView.numberOfSections-1)
tableView.scrollToRow(at: indexPath, at: .bottom, animated: true)
请注意,上述代码假设您的表格视图只有一个分区。如果您的表格视图包含多个分区,则必须相应地修改代码。