Instance Method

initWithPasteboardWriter:

Initializes and returns a dragging item using the specified content.

Declaration

- (instancetype)initWithPasteboardWriter:(id<NSPasteboardWriting>)pasteboardWriter;

Parameters

pasteboardWriter

The object that provides the dragging content. The object must implement the NSPasteboardWriting protocol.

Return Value

An initialized NSDraggingItem instance with the specified dragging content.

Discussion

When the developer creates an NSDraggingItem instance , it is for use with the view method beginDraggingSessionWithItems:event:source: During the invocation of that method, the pasteboardWriter is placed onto the dragging pasteboard for the NSDraggingSession that contains the dragging item instance.

The designated initializer.