• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: canAsynchronouslyWriteToURL:ofType:forSaveOperation: Prevent Quit?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: canAsynchronouslyWriteToURL:ofType:forSaveOperation: Prevent Quit? (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: ARC Retain Cycles
  • Next by Date: Re: canAsynchronouslyWriteToURL:ofType:forSaveOperation: Prevent Quit?
  • Previous by thread: Re: canAsynchronouslyWriteToURL:ofType:forSaveOperation: Prevent Quit?
  • Next by thread: Re: canAsynchronouslyWriteToURL:ofType:forSaveOperation: Prevent Quit?
  • Index(es):
    • Date
    • Thread