How to update tableview cells instead of reloading?

715 views Asked by At

I am building iOS Application using storyboards.

I have a tableview for displaying multiple datas from database.

Also i am using pull down refresh.

In PullDownRefresh i called a method [(void)updateData] where i reload tableview.

At that time image in the cell blinks abruptly while scrolling.

So instead of reloading tableView, i want to update the tableView.

That means i want to add new rows from the last cell.

I am beginnner in iOS.Help is Appreciated.

1

There are 1 answers

3
Santu C On

You may use insertRowsAtIndexPaths of UITableView-

 dispatch_async(dispatch_get_main_queue(), ^{
        [self.tableView beginUpdates];
        [self.tableDatalist insertObject:obj atIndex:index];

        [self.tableView insertRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:index inSection:0]]
                              withRowAnimation:UITableViewRowAnimationRight];
        [self.tableView endUpdates];
    });