I want to update my TableView from a deprecated initWithFrame:reuseIdentifier:
My table view uses custom cells.
It is said throughout that it uses initWithStyle: and that it does not change the behavior or cell in any way from initWithFrame:CGRectZero reuseIdentifier:
But when I build using initWithStyle:UITableViewCellStyleDefault reuseIdentifier: cells become empty (i.e. our custom cell is not working (because it is initialized by some style?)).
After the cell is initialized (if it has not been deleted), we set the texts in the cell. But they are not installed when I use initWithStyle:reuseIdentifier: but it works with initWithFrame:CGRectZero . None of the code changes except the init method used ( initWithStyle ).
These lines are placed after the creation (or use) of the cell:
cell.newsItemNameLabel.text = @"test"; NSLog(@"NewsItemName: %@",cell.newsItemNameLabel.text);
Results in "NewsItemName: (null)"
Does anyone have an idea? What is the difference between the two?
thanks
source share