Hi, im trying to use a custom UITableViewCell, when i try to set a UILabel text nothing appears, the label is blank but if i use the NSLog the label.text is showing the correct title, so i know the label is getting assigned the text value. Any ideas what I'm doing wrong?
heres the code for the MenuView:
```
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString *CellIdentifier = @"Cell";
MenuCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[MenuCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
NSMutableDictionary *menuItem = [menuArray objectAtIndex:indexPath.row];
NSString *title = [menuItem objectForKey: @"Title"];
if (indexPath.row % 2) {
cell.contentView.backgroundColor = [UIColor whiteColor];
}
else{
cell.contentView.backgroundColor = [UIColor darkGrayColor];
cell.menuTitleLabel.textColor = [UIColor whiteColor];
}
cell.menuTitleLabel.text = title;
NSLog(@"MenuTitleLabel = %@", cell.menuTitleLabel.text);
return cell;
}
```
Hi, thanks for your quick response. Yes its strange, if i use:
```
[cell textlabel setText:title];
```
Everything works fine, but soon as i use my custom uilabel the cell is blank, but cell.menuTitleLabel.text has the correct value assigned to it.
Hi, thanks for your quick response. Yes its strange, if i use:
```
[cell textlabel setText:title];
```
Everything works fine, but soon as i use my custom uilabel the cell is blank, but cell.menuTitleLabel.text has the correct value assigned to it.
Ok, I tried making the textLabel background clear, still no difference. I tried setting menuTitleLabel background colour too black too see if it would show up, but the cell remains blank. Im completely confused to why it's behaving in this way.
When i log the cell i get this:
```
Cell: <MenuCell: 0x9e857c0; baseClass = UITableViewCell; frame = (0 0; 200 90); hidden = YES; autoresize = W; layer = <CALayer: 0x9e85970>>
```
For some reason the cell is HIDDEN, I've tried setting the cell.hidden to NO when the cell is initialised, but its still be set as hidden somewhere.