O'Reilly logo

COCOA PROGRAMMING FOR MAC OS X SECOND EDITION by Aaron Hillegass

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 26. Working with NSTextView

NSTextView is a very smart class. It is basically a word processor. It deals with fonts, justification, rulers, graphics, spell-check, undo, drag-and-drop, and copy-and-paste. We could spend days discussing the text system. For many uses of an NSTextView, however, you merely need to read data from the view and insert data into the view.

When we talk about NSTextView, we are actually talking about a whole team of objects that make NSTextView work: An NSTextStorage (which inherits from NSMutableAttributedString) tracks changes to the text and informs the NSLayoutManager. The NSLayoutManager lays out the text in a region that is defined by an NSTextContainer. The NSTextView is the view in which the text is rendered. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required