One Quickie
Table view data source foobage (UITableView->General)
Boilerplate for UITableView DataSource stuff.
// Optional
- (NSInteger) numberOfSectionsInTableView: (UITableView *) tableView {
return 1;
} // numberOfSectionsInTableView
- (NSInteger) tableView: (UITableView *) tableView
numberOfRowsInSection: (NSInteger) section {
return dataArray.count;
} // numberOfRowsInSection
- (UITableViewCell *) tableView: (UITableView *) tableView
cellForRowAtIndexPath: (NSIndexPath *) indexPath {
UITableViewCell *cell =
[tableView dequeueReusableCellWithIdentifier: @"BlahTableViewCell"];
if (!cell) {
cell = [[UITableViewCell alloc]
initWithStyle: UITableViewCellStyleDefault
reuseIdentifier: @"BlahTableViewCell"];
[cell autorelease]; // Delete for ARC
}
cell.textLabel.text = [dataArray objectAtIndex: indexPath.row];
return cell;
} // cellForRowAtIndexPath