title: How to programmatically change the NSAttributedString of a UITextView without modifying the attributes set on the interface builder?
body: <p>I am using the following code to edit the text only, but it is not working:</p>
  
  <pre><code>- (void)updateTextViewWithText:(NSString *)newText
  {      
      NSDictionary *attributes = [self.textView.attributedText attributesAtIndex:0 effectiveRange:NULL];
      self.textView.attributedText = [[NSAttributedString alloc] initWithString:newText attributes:attributes];
  }
  </code></pre>
  
  <p>It is working now. The problem was that on the interface builder the property "Selectable" was not selected for the textView so that was why it returned nil for the attributedText attributes.</p>