I have a little problem and I need to understand how stuff works. I've searched within SO but I didn't find any valid solution.
My scenario is the following.
I have a UITableViewController
that loads cells (within its table using) by means of UINib
method instantiateWithOwner:
.
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
CustomTableViewCell *cell = (CustomTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellClassName];
if (!cell) {
NSArray *topLevelItems = [cellLoader instantiateWithOwner:self options:nil];
cell = [topLevelItems objectAtIndex:0];
}
// other stuff here...
return cell;
}
Cells are displayed correctly. Now, I need to customize each cell based on different criteria and I think the correct place to do it is in awakeFromNib
method. Fr example, within CustomTableViewCell
.m, I override awakeFromNib
like the following:
- (void)awakeFromNib
{
// my internal stuff here
}
But awakeFromNib
is not called.
Could you explain what I'm doing wrong?
Thank you in advance.