Again I’m moving from Xcode 3 to 4 and finding that some things are different. I’m writing a splitview iPad app and working from all the code that was generated for me. In the master view I want to customize the UITableViewCell to use the UITableViewCellStyleSubtitle style. In the past that was simple and I knew it was done within tableView:cellForRowAtIndexPath:.
In the new template code there is no [[UITableViewCell alloc] init....] there is only
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];
so I can’t modify the style here. I looked in the storyboard and found the cell but cannot seem to change the property there either.
In short, I can’t find where the UITableViewCells are alloc/init’ed so that I can make my change. Where is this done in Xcode 4?
If you’re using the storyboard-based template, the cell is created by the storyboard, so you need to configure it in the storyboard in IB. If you haven’t found that, it’s here:
Select the cell, and it’ll be in the attributes inspector. While you’re there you might want to set a reuse identifier you can use in
tableView:cellForRowAtIndexPath:.(You can also use IB to change the font or other properties of the cell’s
textLabelanddetailTextLabeland set accessory styles like you would have before intableView:cellForRowAtIndexPath:.)