I want to be able to replace some text in an UITextView programatically, so I wrote this method as an UITextView category:
- (void) replaceCharactersInRange:(NSR
Shouldn't it be
[[self.undoManager prepareWithInvocationTarget:self] replaceCharactersInRange:NSMakeRange(range.location, newText.length)
withString:[self.text substringWithRange:range]];
And you probably can remove the mutable string and just do,
self.text = [self.text stringByReplacingCharactersInRange:range withString:newText];