0

I was wondering if it is possible to define a UILabel on a Xib file, and on that label define an attributed string with different fonts, styles, sizes, etc...

then wire up that label to a property, but NOT have it loaded on the self.view (because I just want the attributed string data to pass to another view)

when I gave this an attempt, and tried to access the property's "attributedString" variable, it gave me a nil value.

thanks

Uba Duba
  • 241
  • 2
  • 12

1 Answers1

1

I think this piece of code will help you, this code allows you to take in the attributes for whatever (say a label's attributed text) and read in the attributes. The attributes grabbed in this line only take the first character's attributes in the label's attributed text:

NSDictionary *attributes = [self.label.attributedText attributesAtIndex:0 effectiveRange:NULL];
TheCodingArt
  • 3,436
  • 4
  • 30
  • 53