How can I get the font size and font name of a UILabel?

Add a property to your view controller’s .h file:

@property (nonatomic, retain) IBOutlet UILabel *label;

Link the label to this IBOutlet under “File’s Owner” outlets in Interface Builder. If not using ARC, make sure you release it in -dealloc

- (void)dealloc
{
    [self.label release];
    [super dealloc];
}

Then to get the font name and size all you need is

NSString *fontName = self.label.font.fontName;
CGFloat fontSize = self.label.font.pointSize;

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)