Instance Method

loadInPlaceFileRepresentationForTypeIdentifier:completionHandler:

Asynchronously opens a file in place, if doing so is possible, returning an NSProgress object.

Declaration

- (NSProgress *)loadInPlaceFileRepresentationForTypeIdentifier:(NSString *)typeIdentifier completionHandler:(void (^)(NSURL *url, BOOL isInPlace, NSError *error))completionHandler;

Discussion

The system sets the isInPlace parameter to YES if the system successfully opened the file in place, or NO if it made a local copy. In either case, you must access the returned NSURL using an NSFileCoordinator object.

If the system created a local copy of a file, it will be automatically deleted after your file coordinator relinquishes its read access to the file.

See Also

Getting the Item’s Data

- canLoadObjectOfClass:

Returns a Boolean value indicating whether an item provider can load objects of a given class.

- hasItemConformingToTypeIdentifier:

A convenience method equivalent to the hasRepresentationConformingToTypeIdentifier:fileOptions: method, but with the fileOptions parameter set to a value of 0.

- loadItemForTypeIdentifier:options:completionHandler:

Loads the item’s data and coerces it (as needed) to the specified type.

- loadDataRepresentationForTypeIdentifier:completionHandler:

Asynchronously copies the provided, typed data into an NSData object, returning an NSProgress object.

- loadFileRepresentationForTypeIdentifier:completionHandler:

Asynchronously writes a copy of the provided, typed data to a temporary file, returning an NSProgress object.

- loadObjectOfClass:completionHandler:

Asynchronously loads an object of a specified class to an item provider, returning an NSProgress object.

- hasRepresentationConformingToTypeIdentifier:fileOptions:

Returns a Boolean value indicating whether an item provider contains a data representation conforming to a specified uniform type identifier (UTI) and to specified open-in-place behavior.

- registeredTypeIdentifiersWithFileOptions:

Returns an array with a subset of type identifiers for the item provider, according to the specified file options, listed in the same order in which they were registered.