I have made a custom UITableViewCell which has elements like label and a segmentcontrol But when i try to access the elements in the cellforrowatindexpath the elements are not allocated any memory . the cell instance has been allocated memory . i have checked the xib and connected the outlets.
Here is the code in the cellforrowatindexpath-
SegmentCell *cell;
[tableView registerNib:[UINib nibWithNibName:@"SegmentCell" bundle:nil] forCellReuseIdentifier:@"SegmentCell"];
[tableView registerClass:[SegmentCell class] forCellReuseIdentifier:@"SegmentCell"];
cell = (SegmentCell *)[tableView dequeueReusableCellWithIdentifier:@"SegmentCell" forIndexPath:indexPath];
cell.title.text=@"Hell*emphasized text*o";
return cell;
The title is the label which shows nil in print description
UITableViewCell’s
titleis a deprecated property of type NSString, not UILabel. Use thetitleLabelproperty instead.cell.titleLabel.text = @"whatever";