It's a mistake to change a text view's text in the selectionChanged delegate method because that method is called repeatedly for intermediate steps in the selection, and it's called again after the text is modified.
Modifying the text attributes in a selected range is easily done while the selection is held still. For example, if have add a button, or some other event to trigger the change...
// assuming you have an outlet to the text view called textView.
// assuming you have a button set to trigger this action.
- (IBAction)doit:(id)sender {
// this way, the old attributed state will be removed and replaced
// NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:self.textView.text];
// this way, we'll add attributes to the existing attributes
NSMutableAttributedString *attributedString = [self.textView.attributedText mutableCopy];
UIFont *font = [UIFont boldSystemFontOfSize:17];
NSRange selectedRange = [self.textView selectedRange];
[attributedString setAttributes:@{ NSFontAttributeName: font } range:selectedRange];
[self.textView setAttributedText:attributedString];
}