• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: appending a string to an NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >appending a string to an NSTextView (From: Roland Silver <email@hidden>)

  • Prev by Date: Re: appending a string to an NSTextView
  • Next by Date: Re: NSAttributedString drawing and NSText drawing
  • Previous by thread: Re: appending a string to an NSTextView
  • Next by thread: NSPasteboard: writing non-existent filename
  • Index(es):
    • Date
    • Thread