O'Reilly logo

The Core iOS Developer’s Cookbook, Fifth Edition by Rich Wardwell, Erica Sadun

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding Cells

Recipe 9-3 uses an Add button to create new content for the table. This button takes the form of a system bar button item, which displays as a plus sign. (See the top-left corner of Figure 9-5.) The addItem: method in Recipe 9-3 appends a new random image at the end of the items array.

Recipe 9-3 Editing Tables

@implementation TestBedViewController {     NSMutableArray *items; } #pragma mark Data Source // Number of sections - (NSInteger)numberOfSectionsInTableView:(UITableView *)aTableView {     return 1; } // Rows per section - (NSInteger)tableView:(UITableView *)aTableView     numberOfRowsInSection:(NSInteger)section {     return items.count; } // Return a cell for the index path - (UITableViewCell ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required