I created a new custom TableViewCell by subclassing UITableViewCell. I created a table view with UIImage view using a nib and I hooked it with view’s outlets. Then while populating the table from my TableView delegate, I used the subclass for return table view cells.
New content from the nib is getting loaded. But the new size of custom table view cell (i resized the table view cell to a new large size) is not getting loaded in the table view.
Am I missing some call during the rendering? Please help
@interface AccountOption : UITableViewCell
{
IBOutlet UIImageView* optionIcon;
}
@property (nonatomic, retain) IBOutlet UIImageView* optionIcon;
@end
In delegate,
NSArray* topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"AccountOption" owner:nil options:nil];
for (id currentCell in topLevelObjects) {
if ([currentCell isKindOfClass:[AccountOption class]]) {
cell = currentCell;
}
}
cell.optionIcon.image = [(NSDictionary*)[accountOptions objectAtIndex:indexPath.row] objectForKey:@"icon"];
return cell;
You need to set the table view’s row height either in interface builder, in code in your view controller, or in the table view delegate method
tableView:heightForRowAtIndexPath: