I am using the following code to edit the text only, but it is not working:
- (void)updateTextViewWithText:(NSString *)newText
{
NSDictionary *attributes = [self.textView.attributedText attributesAtIndex:0 effectiveRange:NULL];
self.textView.attributedText = [[NSAttributedString alloc] initWithString:newText attributes:attributes];
}
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.
It worked when I tried your code sample. It sounds like either your textView IBOutlet is not connected or in Interface Builder you have to change your text from "Plain" to "Attributed".