Re: canAsynchronouslyWriteToURL:ofType:forSaveOperation: Prevent Quit?
Re: canAsynchronouslyWriteToURL:ofType:forSaveOperation: Prevent Quit?
- Subject: Re: canAsynchronouslyWriteToURL:ofType:forSaveOperation: Prevent Quit?
- From: Trygve Inda <email@hidden>
- Date: Sun, 20 Apr 2014 16:23:37 -0700
- Thread-topic: canAsynchronouslyWriteToURL:ofType:forSaveOperation: Prevent Quit?
> Do you override any other NSDocument saving methods? I believe NSDocument’s
> internal use of -performAsynchronousFileAccess… should cause it to delay
> NSApplication termination.
>
> --Kyle Sluder
>
My Document class contains:
// Read File Package
-(BOOL)readFromFileWrapper:(NSFileWrapper *)fileWrapper ofType:(NSString
*)typeName error:(NSError **)outError;
// Write File Package
-(NSFileWrapper *)fileWrapperOfType:(NSString *)typeName error:(NSError
**)outError;
-(BOOL)canAsynchronouslyWriteToURL:(NSURL *)url ofType:(NSString *)typeName
forSaveOperation:(NSSaveOperationType)saveOperation;
-(void)setFileURL:(NSURL *)absoluteURL;
SetFileURL looks like:
-(void)setFileURL:(NSURL *)absoluteURL
{
[super setFileURL:absoluteURL];
if ([self documentFileWrapper])
[documentFileWrapper readFromURL:absoluteURL options:0 error:NULL];
}
If I choose save and immediately close the document, it closes right away
but the file still gets written a few moments later.
However, if I choose save and immediately quit, it quits without writing the
file.
T.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden