Type Method

canInitWithPasteboard:

Returns a Boolean value indicating whether the receiver can initialize itself from the data on the specified pasteboard.

Declaration

+ (BOOL)canInitWithPasteboard:(NSPasteboard *)pasteboard;

Parameters

pasteboard

The pasteboard containing the image data.

Return Value

YES if the receiver understands the format of the specified data and can use it to initialize itself; otherwise, NO.

Discussion

This method invokes the imageUnfilteredPasteboardTypes class method and checks the list of types returned by that method against the data types in pasteboard. If it finds a match, it returns YES. When creating a subclass of NSImageRep that accepts image data from a non-default pasteboard type, override the imageUnfilteredPasteboardTypes method to assure this method returns the correct response.

See Also

Determining the Supported Image Types

+ canInitWithData:

Returns a Boolean value indicating whether the receiver can initialize itself from the specified data.

imageTypes

Returns an array of UTI strings identifying the image types supported by the receiver, either directly or through a user-installed filter service.

imageUnfilteredTypes

Returns an array of UTI strings identifying the image types supported directly by the receiver.

+ imageFileTypes

Returns the file types supported by NSImageRep or one of its subclasses.

Deprecated
+ imagePasteboardTypes

Returns the pasteboard types supported by NSImageRep or one of its subclasses.

Deprecated
+ imageUnfilteredFileTypes

Returns the list of file types supported directly by the receiver.

Deprecated
+ imageUnfilteredPasteboardTypes

Returns the list of pasteboard types supported directly by the receiver.

Deprecated