InitWithStyle: (UITableViewCellStyle) not being called
Weird thing just started, I am trying to create my own table, but my initWithStyle is not getting called.
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
My Tablecell looks ok:
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
// Initialization code
NSLog(@"xx1111");
}
return self;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
How do I try to load the Customcell nib item:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *TFDCustomCell = @"TFDCell";
TFDCell *cell = (TFDCell *)[tableView dequeueReusableCellWithIdentifier:TFDCustomCell];
if (cell == nil) {
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"TFDCell"
owner:self options:nil];
for (id oneObject in nib) if ([oneObject isKindOfClass:[TFDCell class]])
cell = (TFDCell *)oneObject;
}
return cell;
}
But NSLog(@"xx1111");
doenst appears in my logs. When I set NSLog to 'setSelected' it works "fine"
+3
source to share