title: UITextView - Setting attributes
body: <p>I have a UITextView and a bar with three buttons which toggle bold, italic and underline.
  I've set the TextView's text to attributed and it's "Allow Editing Attributes" option to YES.
  Although the code for editing a selected text is working (here's an example):</p>
  
  <pre><code>       UIFont *font = [UIFont fontWithName:@"HelveticaNeue-Light" size:20];
  
      NSDictionary *dict = [NSDictionary dictionaryWithObject:font forKey:NSFontAttributeName];
  
  
  
      //edit selection
  
      NSRange selectedRange = _noteTextView.selectedRange;
  
  
      [[_noteTextView textStorage] beginEditing];
  
      [[_noteTextView textStorage] addAttribute:NSFontAttributeName value:font range:selectedRange];
  
      [[_noteTextView textStorage] addAttribute:NSForegroundColorAttributeName value:[UIColor lightGrayColor] range:selectedRange];
  
      [[_noteTextView textStorage] endEditing];
  
  
  
      [[_noteTextView textStorage] setAttributes:dict range:selectedRange];
  </code></pre>
  
  <p>I am having problems with setting the attributes at my textview's indicator.
  <code>[[_noteTextView textStorage] addAttribute:]</code> is not working or I might have a problem with the range.
  Any advice?
  Thanks in advance!</p>