Re: appending a string to an NSTextView
Re: appending a string to an NSTextView
- Subject: Re: appending a string to an NSTextView
- From: Douglas Davidson <email@hidden>
- Date: Tue, 30 May 2006 09:25:57 -0700
On May 29, 2006, at 6:48 AM, Roland Silver wrote:
What's the simplest way to append a given NSString to the end of
the text in a NSTextView?
Fortunately, there is a piece of documentation directly on point:
<http://developer.apple.com/documentation/Cocoa/Conceptual/
TextArchitecture/Tasks/SimpleTasks.html>
Look at the rest of the Text System Architecture document for more
information. For more complex manipulation of the text, one usually
works directly with the text storage as a mutable attributed string.
This covers programmatic change to the text. For text changes that
are intended to be treated as the result of user action, and so to be
undoable and so forth, you would precede the actual changes with a
call to -shouldChangeTextInRange:replacementString: or -
shouldChangeTextInRanges:replacementStrings: and follow them with a
call to -didChangeText.
Douglas Davidson
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden