March 2012
Intermediate to advanced
590 pages
22h 48m
English
There are a number of ways to add rows to a table view at runtime. The built-in behavior for adding a row is to display a new row with a green plus sign icon. However, this technique has fallen out of favor because it’s cumbersome to enter editing mode and then find the row with the plus sign icon – especially in large tables.
So we’re going to use the New button in the header view instead. When this button is tapped, a new row will be added to the UITableView. In ItemsViewController.m, implement addNewItem:.
- (IBAction)addNewItem:(id)sender { // Make a new index path for the 0th section, last row int lastRow = [[self ...Read now
Unlock full access