替换NSTextView的某个字符串
NSString *textContents = [[self.textView textStorage] string];
NSRange replaceRange = NSMakeRange(0, [self.textView.textStorage length]);
NSRange find = {0,0};
find = [textContents rangeOfString:@"REPLACE_STR" options:0 range:replaceRange];
if (find.length > 0) {
[self.textView replaceCharactersInRange:find withString:newString];
}