NSTextStorageDelegate Protocol Reference

Conforms to
Framework
/System/Library/Frameworks/AppKit.framework
Availability
Available in OS X v10.6 and later.
Declared in
NSTextStorage.h
Companion guides
Related sample code

Overview

The NSTextStorageDelegate protocol defines the optional methods implemented by delegates of NSTextStorage objects.

Tasks

Handling Text Edited Messages

Instance Methods

textStorageDidProcessEditing:

Sent when a text storage has finished processing edits.

- (void)textStorageDidProcessEditing:(NSNotification *)aNotification
Parameters
aNotification

A notification named NSTextStorageDidProcessEditingNotification.

Discussion

The delegate can verify the final state of the text storage object; it can’t change the text storage object’s characters without leaving it in an inconsistent state, but if necessary it can change attributes. Note that even in this case it’s possible to put a text storage object into an inconsistent state—for example, by changing the font of a range to one that doesn’t support the characters in that range (such as using a Latin font for Kanji text).

Availability
  • Available in OS X v10.0 and later.
  • Available as part of an informal protocol prior to OS X v10.6.
Declared In
NSTextStorage.h

textStorageWillProcessEditing:

Sent when a text storage is about to process edits.

- (void)textStorageWillProcessEditing:(NSNotification *)aNotification
Parameters
aNotification

A notification named NSTextStorageWillProcessEditingNotification.

Discussion

The delegate can verify the changed state of the text storage object and make changes to the text storage object’s characters or attributes to enforce whatever constraints it establishes. Programmatic changes don’t result in this message being sent.

Availability
  • Available in OS X v10.0 and later.
  • Available as part of an informal protocol prior to OS X v10.6.
Declared In
NSTextStorage.h