Who Should Read This Document
Organization of This Document
See Also
Text Editing describes ways in which you can control the behavior of the Cocoa text system as it performs text editing. Text editing is the modification of text characters or attributes by interacting with a text view object, either programmatically or by direct user action.
You should read this programming topic if you need to understand how text editing works and how to modify that behavior.
To understand the information in this programming topic you should have prior general knowledge of the text system’s capabilities and architecture, as well as basic Cocoa programming conventions.
This programming topic contains the following articles:
“Overview of Text Editing” provides a high-level view of the text editing mechanism and explains the message sequence that occurs when a text view receives a key event.
“Synchronizing Editing” explains the batch editing concept and shows how to force the end of editing, which sends notifications and leaves the text backing store in a consistent state.
“Intercepting Key Events” explains how to catch key events received by an NSTextView
object so that you can modify their effect.
“Delegate Messages and Notifications” describes the messages the text view delegate and registered observers of the text system can receive.
“Subclassing NSTextView” explains the responsibilities an NSTextView
subclass must fulfill to interact successfully with the text system.
“Setting Focus and Selection Programmatically” explains how to make a text view the first responder and how to manipulate the selection programmatically.
“Working With the Field Editor” explains how the text system uses the field editor and how you can modify that behavior.
“Handling Drops in a Text Field” explains how to add drag-and-drop support to a text field, which includes providing a custom field editor for the text view.
Text System User Interface Layer Programming Guide for Cocoa provides more information about the primary interface to the text system, the NSTextView
class.
The other programming topics in the text system area also have information related to text editing. In addition, please refer to the Cocoa text-related code samples on the Apple Developer Connection website and the Application Kit examples installed with Xcode Tools.
© 2003, 2008 Apple Inc. All Rights Reserved. (Last updated: 2008-02-08)