Instance Method

initWithFileWrapper:

Creates a new text attachment object to contain the given file wrapper.

Declaration

- (instancetype)initWithFileWrapper:(NSFileWrapper *)fileWrapper;

Parameters

aWrapper

The file wrapper for the attachment.

Return Value

A new text attachment object initialized with the file wrapper.

Discussion

This method is the designated initializer for the NSTextAttachment class in macOS.

If aWrapper contains an image file that the receiver can interpret as an NSImage object, this method sets the attachment cell’s image to that image rather than to the icon of aWrapper.

See Also

Initializing a Text Attachment

- initWithData:ofType:

Initializes a new NSTextAttachment object with the given data.

+ textAttachmentWithImage:

Creates a new text attachment object to contain the specified image