iOS Question

iOS change font size programmatically not work

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
self.backgroundColor = [UIColor clearColor];
if ([[UIDevice currentDevice].systemVersion floatValue] < 7.0f) {
self.textLabel.backgroundColor = [UIColor whiteColor];

_topUserNewName= [[UILabel alloc] init];
_topUserNewName.textAlignment = NSTextAlignmentLeft;
_topUserNewName.backgroundColor = [UIColor clearColor];
_topUserNewName.font = [UIFont fontWithName:@"HelvaticaNeue-Regular" size:5.0];
_topUserNewName.textColor = [UIColor colorWithRed:(47/255.0) green:(55/255.0) blue:(65/255.0) alpha:1];
_topUserNewName.frame = CGRectMake(66, 8, 215, 21);

_topUserName= [[UILabel alloc] init];
_topUserName.textAlignment = NSTextAlignmentLeft;
_topUserName.backgroundColor = [UIColor clearColor];
_topUserName.font = [UIFont fontWithName:@"HelvaticaNeue-Regular" size:10.0];
_topUserName.textColor = [UIColor colorWithRed:(145/255.0) green:(212/255.0) blue:(210/255.0) alpha:1];
_topUserName.frame = CGRectMake(66, 37, 210, 21);

[self.contentView addSubview:_topUserNewName];
[self.contentView addSubview:_topUserName];

self.selectionStyle = UITableViewCellSelectionStyleNone;
return self;

This codes in my table cell class. I want to change font size with programmatically right here when i change size nothing change ?
i researched on google this rule is right but not work any idea ?

Answer Source

The name HelveticaNeue-Regulardoes not actually exist. This should be [UIFont fontWithName:@"HelvaticaNeue" size:10.0];.

You can see the list of all font names here :

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download