Initializes a text view.
SDK
- macOS 10.0+
Framework
- App
Kit
Declaration
- (instancetype)initWithFrame:(NSRect)frameRect textContainer:(NSText Container *)container;
Parameters
frameRect
The frame rectangle of the text view.
aTextContainer
The text container of the text view.
Return Value
An initialized text view.
Discussion
This method is the designated initializer for NSText
objects.
Unlike init
, which builds up an entire group of text-handling objects, you use this method after you’ve created the other components of the text-handling system—a text storage object, a layout manager, and a text container. Assembling the components in this fashion means that the text storage, not the text view, is the principal owner of the component objects.