Instance Method

filePromiseProvider:writePromiseToURL:completionHandler:

Writes the contents of a promise to the specified URL.

Required.

Declaration

- (void)filePromiseProvider:(NSFilePromiseProvider *)filePromiseProvider writePromiseToURL:(NSURL *)url completionHandler:(void (^)(NSError *errorOrNil))completionHandler;

Parameters

filePromiseProvider

The file promise provider.

url

The destination URL to write to.

completionHandler

A completion handler to execute after the file has been written.

Discussion

This method is called after the drag is complete. The request executes on the NSOperationQueue supplied by operationQueueForFilePromiseProvider:.

Call the completion handler with the file contents wrapped in NSFileCoordinator. Be sure to write your file to the input url parameter.

See Also

Handling File Promises

- filePromiseProvider:fileNameForType:

Provides the drag destination file's name.

Required.

- operationQueueForFilePromiseProvider:

Returns the operation queue from which to issue the write request.