Skip to content

Instantly share code, notes, and snippets.

@pratikshabhisikar
Created August 9, 2011 10:10
Show Gist options
  • Save pratikshabhisikar/1133705 to your computer and use it in GitHub Desktop.
Save pratikshabhisikar/1133705 to your computer and use it in GitHub Desktop.
Add new cell to table
// Get number of rows in your table.
NSUInteger existingRows = ...;
// Create the index path of new cell to be added.
NSIndexPath *newCellIndexPath = [NSIndexPath indexPathForRow:existingRows inSection:0];
// Update the datasource model...
// Add the new cell to table.
[self.myTableView insertRowsAtIndexPaths:[NSArray arrayWithObject:newCellIndexPath] withRowAnimation:UITableViewRowAnimationFade];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment