// 添加cell到tableView中
NSIndexPath * newIndexPath = [NSIndexPath indexPathForRow:self.historyArr.count-1 inSection:0];
[self.chatTableView beginUpdates];
[self.chatTableView insertRowsAtIndexPaths:[NSArray arrayWithObject:newIndexPath] withRowAnimation:UITableViewRowAnimationBottom];
[self.chatTableView endUpdates];
[self.chatTableView scrollToRowAtIndexPath:newIndexPath atScrollPosition:UITableViewScrollPositionBottom animated:YES];
// 添加刷新后使tableView恢复frame
[self.chatTableView reloadData];
这部分工作在dispatch_get_main_queue主线程中进行,否则的话在自己的代码中出现刷新不及时,视图层显示以前cell的数据