I\'m a newbie with the Storyboard and so I have some difficulties...
I have created a TableViewController and I would like to customize the Cell Prototype. In the Ce
Yeah you can't connect views that are inside of a custom prototype cell using the ctrl+drag method. Instead use the tag property of the view and then when you are building the cell pull the labels out using their tags.
Here:
//Let's assume you have 3 labels. One for a name, One for a count, One for a detail
//In your storyboard give the name label tag=1, count tag=2, and detail tag=3
- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
CustomTableViewCell *theCell = [tableView dequeueReusableCellWithIdentifier:@"Prototype Cell"];
UILabel *nameLabel = (UILabel *)[theCell viewWithTag:1];
UILabel *countLabel = (UILabel *)[theCell viewWithTag:2];
UILabel *detailLabel = (UILabel *)[theCell viewWithTag:3];
nameLabel.text = @"name";
countLabel.text = @"count";
detailLabel.text = @"details";
return theCell;
}
You could also set the labels up as properties in your custom cell code and then when the cell is initialized use the viewWithTag call to assign the label properties to the labels you have created on your storyboards.
It took me a few days to realize I couldn't ctrl+drag from inside a custom cell to create an IBOutlet.
Good luck!
EDIT: You CAN create IBOutlets for your labels inside of a custom cell and create the links programatticaly, just not through the ctrl+drag method.
EDIT 2: I was totally wrong, you can ctrl+drag. See the second answer to this question. It is tricky, but it works quite well.