Using the High-Level Text Classes

Cocoa’s text system is extremely complex. The complexity is needed to support state-of-the-art features and a high degree of customizability. However, it is possible to use the text system without exposing the underlying complexity. High-level features common to most applications are easily accessed. The details and complexity are only encountered when using advanced or specialized features.

The easiest way to include formatted text display and input in a Cocoa application is to drag a text object from the Interface Builder Cocoa-Data palette. The NSTextView object on the Interface Builder palette is actually an instance of the NSTextView class embedded as the document view of a scroll view. Scroll views, the ...

Get Cocoa® Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.