Skip navigation.
 
mlRe: Clearing an NSTextView
FROM : Jeremy
DATE : Sun Feb 24 21:23:58 2008

I.S.,

I knew insertText: wouldn't remove the text. I just can't figure out 
how to remove it all. And how do I select all of characters? That 
would be my only problem with the 
replaceCharactersInRange:withString:...

Thanks,
Jeremy
"For a long time it puzzled me how something so expensive, so leading 
edge, could be so useless, and then it occurred to me that a computer 
is a stupid machine with the ability to do incredibly smart things, 
while computer programmers are smart people with the ability to do 
incredibly stupid things. They are, in short, a perfect match." - Bill 
Bryson


On Feb 24, 2008, at 3:20 PM, I. Savant wrote:

>> When I use [NSTextView insertText:@"Lyrics Code Here"];, it doesn't 
>> delete the current text so that is it is replaced for the user...

>
>
>  Why would you believe "insert" means anything but? If you read the 
> documentation on the text system, you'll get a better idea of where 
> to look for more answers.
>
>  You can ask the text view for its NSTextStorage (which is a 
> subclass of NSMutableAttributedString) and replace the contents with 
> -replaceCharactersInRange:withString: or -
> replaceCharactersInRange:withAttributedString:
>
> --
> I.S.
>
>

Related mailsAuthorDate
mlClearing an NSTextView Jeremy Feb 24, 20:43
mlRe: Clearing an NSTextView Gary L. Wade Feb 24, 21:16
mlRe: Clearing an NSTextView I. Savant Feb 24, 21:20
mlRe: Clearing an NSTextView Jeremy Feb 24, 21:23
mlRe: Clearing an NSTextView I. Savant Feb 24, 21:28
mlRe: Clearing an NSTextView I. Savant Feb 24, 21:30
mlRe: Clearing an NSTextView I. Savant Feb 24, 21:33
mlRe: Clearing an NSTextView Jeremy Feb 24, 21:34
mlRe: Clearing an NSTextView I. Savant Feb 24, 21:38
mlRe: Clearing an NSTextView Jeremy Feb 24, 21:44