Can I set the attributedText property of a UILabel object? I tried the below code:
UILabel *label = [[UILabel alloc] init];
label.attributedText = @"asdf";
But it gives this error:
Property “attributedText” not found on object of type ‘UILabel *’
#import <CoreText/CoreText.h> not working
Unfortunately,You can use OHAttributedLabel instead.UILabeldoesn’t support attributed strings.Update: Since iOS6,
UILabeldoes support attributed strings. See UILabel reference or Michael Kessler’s answer below for more details.