Instance Method

revealDocumentAtURL:importIfNeeded:completion:

Reveals (and optionally imports) the document at the provided URL.

Declaration

- (void)revealDocumentAtURL:(NSURL *)url importIfNeeded:(BOOL)importIfNeeded completion:(void (^)(NSURL *revealedDocumentURL, NSError *error))completion;

Parameters

url

The URL of the document to reveal.

importIfNeeded

A Boolean value that determines whether the document browser should import the document.

completion

A completion block with the following parameters:

url

The new URL of an imported document. Set to nil if shouldImport is NO, or if an error occurs.

error

If an error occurs, this parameter contains the error information; otherwise, set to nil.

Discussion

Call this method to display a document in the document browser.

If importIfNeeded is YES, the document browser calls its delegate's documentBrowser:didImportDocumentAtURL:toDestinationURL: method (or its documentBrowser:failedToImportDocumentAtURL:error: method, if an error occurred) before calling the completion handler.

See Also

Configuring a Document Browser

allowedContentTypes

The document types that the browser can open.

allowsDocumentCreation

A Boolean value that determines whether the document browser can create new documents.

allowsPickingMultipleItems

A Boolean value that determines whether the user can select and open more than one document at a time.