I have just finished a project where I use a custom cell for my TableView in Storyboard.
The problem is that when i scroll down the content in each cell is gone, which in my case is two Labels.
This is the code I use to present each cell:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"CustomCell";
MessageCell *cell = (MessageCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[MessageCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
Message *messageForRow = (Message *)[messages objectAtIndex:[indexPath row]];
[cell.messageLabel setText:[messageForRow message]];
[cell.senderLabel setText:[messageForRow sender]];
return cell;
}
I have specified the right cellidentifier in storyboard and linked the Class to my custom cell class.
What can be wrong? If there is any needed information I have missed to present, please tell me.
Best regard Robert