I try to change a font size in my UITextView and every time I change the attributedText was restore to default.
with this I make the middle test bold :
str = [[NSMutableAttributedString alloc] initWithAttributedString:string];
[str addAttribute:NSFontAttributeName value:newFont range:NSMakeRange(range.location, range.length)];
before: that was bold font in the middle.
after :all the text bold
I want that after the size change the bold stay where he be.
Edit :
I try with this two ways :
1)
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:currentTextViewEdit.text];
[attributedString addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:textSize] range:NSMakeRange(0, currentTextViewEdit.text.length)];
currentTextViewEdit.attributedText = attributedString;
2)
currentTextViewEdit.font = [UIFont fontWithName:currentTextViewEdit.font.fontName size:textSize];