CocoaDev

Edit AllPages

NSTextView+CocoaDevUsersAdditions.h

@interface NSTextView (CocoaDevUsersAdditions)

@end

@implementation NSTextView (CocoaDevUsersAdditions)

@end

Ummm, can’t you just do [[[self textStorage] mutableString] appendString:str] instead of the much more complex method replaceCharactersInRange:withString:? (By complex I mean algorithmically) –[[JediKnil

I rather doubt that it is more complex algorithmically. In fact, the two different methods will probably end up invoking the exact same core method to do the actual work.

True, but JK’s method is easier to grok. Someone make sure it works and change the code snippet, plz k thx! DustinVoss

Category:CocoaDevUsersAdditions