UITableView RegisterNib func is called, however awakeFromNib func is never called

39 views Asked by At

Here is the snippet for register nib:

[tableView registerNib:[self returnNib] forCellReuseIdentifier:identifier];
    cell = [tableView dequeueReusableCellWithIdentifier:identifier];

then here is the snippet from awakeFrom nib:

- (void)awakeFromNib {
    [super awakeFromNib];
    [self setupCellStyle];
}

and here my own method returning the nib

+ (UINib *)returnNib {
    NSBundle *bundle = [NSBundle bundleForClass:[self class]];
    NSString *pathForResource = [bundle pathForResource:NSStringFromClass([self class])  ofType:@"nib"];
    UINib *nib = [UINib nibWithNibName:NSStringFromClass([self class]) bundle:bundle];
    return nib;
}
0

There are 0 answers