Friday, 19 December 2014

Insert new cells in a UITableView (OR) Middle of the UITableView



[self.dataSourceArray insertObject:object atIndex:indexPath.row];
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
[self.tableView insertRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];


(OR)


    NSInteger row = 1;
    NSIndexPath *indexPath = [NSIndexPath indexPathForRow:row inSection:0];

    [self.dataSourceArray insertObject:object atIndex:indexPath.row];
    [self.ItineraryTableView insertRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];

    

No comments:

Post a Comment