Instance Method


Lazily registers an item, according to the NSItemProvider type coercion policy.


- (void)registerItemForTypeIdentifier:(NSString *)typeIdentifier loadHandler:(NSItemProviderLoadHandler)loadHandler;



A string that represents the desired UTI.


A block capable of returning the data item as the specified type. For information about implementing this block, see NSItemProviderLoadHandler.


Use this method to register blocks that can take the item provider’s file or data object and convert it to a specific data format. Your loadHandler block is executed when a client passes the same typeIdentifier string to the loadItemForTypeIdentifier:options:completionHandler: method. In the implementation of your block, coerce the data to the specified type and call the provided completion handler. You must call the completion handler, either with the requested data or with an error.

Item providers know how to coerce known types of objects, such as images or strings. Use this method to register blocks to coerce your custom data types.

See Also

Registering Custom Coercion Handlers


Returns the array of type identifiers for the item provider, listed in the same order in which they were registered.