I don't know if this is specific to UITableViewCells , but rather common to UIViews (as I believe), but I noticed a problem with the cell.
As already mentioned, I have a custom subclass of UITableViewCell that loads from xib when it is initialized with the assigned init:
- (id)initWithReuseIdentifier:(NSString *)reuseIdentifier { NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"MyCell" owner:nil options:nil]; self = nib[0]; if (self) {
It has UILabel as an output, and I set some of its properties in the awakeFromNib method:
- (void)awakeFromNib{ [super awakeFromNib]; self.labelLeft.textColor = [UIColor grayColor]; self.labelLeft.font = [UIFont boldSystemFontOfSize:15.0f]; }
The fact is that the shortcut does not save the textColor or font, and I do not understand why.
awakeFromNib is called and the output is connected correctly, since I can set the text.
I can get it to work with the settings for these properties after I set its text to a UITableViewDataSource , but I do not think it is correct, and I want to understand why this does not work.
Question :
Why doesn't it save the font and text and what can I do to make it work correctly?
source share