在tableView的顶部第0行插入一个cell
过程是这样的:使用百度推送每次会推送来一条消息,页面监控推送信息,将新推送来的消息加入到该页面原有的tableView中(加入到顶端的第0行),这个怎么破??
-(void)addRows{
NSMutableArray *indexPaths = [[NSMutableArray alloc] init];
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
[indexPaths addObject: indexPath];
[self.tableView beginUpdates];
[self.tableView insertRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationLeft];
[self.tableView endUpdates];
}
貌似是要用这句 [self.tableView insertRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationLeft];但是怎么编辑新插入的这个cell啊.........
找到出问题的位置了, 做过修改之后可以实现在tableView的第0行插入一个新的cell