Asynchronously opens a file in place, if doing so is possible, returning an NSProgress
object.
SDKs
- iOS 11.0+
- macOS 10.13+
- Mac Catalyst 13.0+
- tvOS 11.0+
- watchOS 4.0+
Framework
- Foundation
Declaration
- (NSProgress *)loadInPlaceFileRepresentationForTypeIdentifier:(NSString *)typeIdentifier completionHandler:(void (^)(NSURL *url, BOOL isInPlace, NSError *error))completionHandler;
Discussion
The system sets the is
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 NSFile
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.