iOS Table View Refresh Cell

前端 未结 3 1583
刺人心
刺人心 2021-02-04 01:46

I followed the advice in the link below to add images to cells in a table view.

Adding Image to Table Cell (iOS)

Is there a way to force refresh a cell i.e. add/

3条回答
  •  青春惊慌失措
    2021-02-04 02:31

    You can call [self.tableview reloadData]; on the tableview and refresh the entire table.

    Otherwise you can do this to refresh a single cell.

     [self.tableView beginUpdates];
     [self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPathOfYourCell] withRowAnimation:UITableViewRowAnimationNone];
     [self.tableView endUpdates];
    

提交回复
热议问题