This is all we need to do now when grabbing a cell for display in a UITableViewController in iOS6:

– (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @”carTableCell”;
CarTableViewCell *cell = [tableView
dequeueReusableCellWithIdentifier:CellIdentifier
forIndexPath:indexPath];

// Configure the cell here …

return cell;
}
[/sourecode]

We used to have to do this (but not anymore – iOS6 now takes care of this for us)

// This step no longer required in iOS 6
if (cell == nil) {
cell = [[CarTableViewCell alloc]
initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:CellIdentifier];
}
[/sourecode]

Note: You still need the above code if you are working with customer xibs and cells.

Links that help:
http://www.techotopia.com/index.php/An_Overview_of_iOS_6_Table_Views_and_Xcode_Storyboards

Advertisement