I was watching the 2011 WWDC tutorial for storyboards.
In the tutorial I noticed the following code:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSindexPath *__strong)indexPath
{
// The identifier is defined in the storyboard
MyCustomCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MyCustomCell"];
return cell;
}
QUESTION:
Is this a new feature in iOS 5 that doesn’t require you to initialize a cell before trying to reuse it?
I feel like there is too much magic in iOS 5.
That’s right. Instead of having to make a nib for a custom cell, you can edit a prototype cell in Storyboard. All you have to do is set the Identifier in Storyboard, and then you can get cells from
dequeueReusableCellWithIdentifier:without having to allocate and initialize them yourself.