Hello i have tableview with many objects in it. If i want to add one row in it without reloading whole table. Because there are some process in cell. Anybody can help ?
You can do it in 2 ways -
[tableView beginUpdates];
[tableView insertRowsAtIndexPaths:newResults withRowAnimation:UITableViewRowAnimationNone];
[tableView endUpdates];
or
[tableView insertRowsAtIndexPaths:newResults withRowAnimation:UITableViewRowAnimationNone];
here newResults
are an NSArray
of NSIndexPath
which you need to create. Then the new rows are inserted (with some animation or without) at those rows.
Use below delegate method
- (void)insertRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With