
Please explain the NSAttributedString in Objective C and also give an example. Thanks.

NSMutableAttributedString* attrStr = [NSMutableAttributedString attributedStringWithString:@"Hello World!"]; [attrStr setFont:[UIFont systemFontOfSize:12]]; [attrStr setTextColor:[UIColor grayColor]]; [attrStr setTextColor:[UIColor redColor] range:NSMakeRange(0,5)]; myAttributedLabel.attributedText = attrStr; myAttributedLabel.textAlignment = UITextAlignmentJustify;

NSMutableAttributedString Example