• 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: NSDocument -canAsynchronouslyWriteToURL::: never called
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDocument -canAsynchronouslyWriteToURL::: never called


  • Subject: Re: NSDocument -canAsynchronouslyWriteToURL::: never called
  • From: Markus Spoettl <email@hidden>
  • Date: Sun, 10 Jun 2012 20:23:59 +0200

On 6/10/12 7:45 PM, Markus Spoettl wrote:
Well, it suddenly started working and the reason is that apparently you need to
have

-saveToURL:ofType:forSaveOperation:completionHandler:

overwritten. If you don't you just don't get to use background writing.
Overwriting this method does the trick. One would think that the existence of

-canAsynchronouslyWriteToURL:ofType:forSaveOperation:

should be indication enough that one really, truly wants to use it. I have a
suspicion that it has to do with my overwriting of

-saveToURL:ofType:forSaveOperation:error:

which as of 10.7 is deprecated in favor of a 10.7 version:

-saveToURL:ofType:forSaveOperation:completionHandler:

Of course that's no good if you want to support 10.6 as well.

Final episode in this epic play...

The documentation on

-saveToURL:ofType:forSaveOperation:completionHandler:

states:

--------
For backward binary compatibility with Mac OS X v10.6 and earlier, the default implementation of this method instead invokes saveToURL:ofType:forSaveOperation:error: if that method is overridden and this one is not, and it passes any error to the completion handler.
--------

Which I guess is what they should also put into -canAsynchronouslyWriteToURL::

Documentation enhancement suggestion filed.

Regards
Markus
--
__________________________________________
Markus Spoettl
_______________________________________________

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: 
 >NSDocument -canAsynchronouslyWriteToURL::: never called (From: Markus Spoettl <email@hidden>)
 >Re: NSDocument -canAsynchronouslyWriteToURL::: never called (From: Markus Spoettl <email@hidden>)

  • Prev by Date: Re: NSDocument -canAsynchronouslyWriteToURL::: never called
  • Next by Date: Re: NSDocument -canAsynchronouslyWriteToURL::: never called
  • Previous by thread: Re: NSDocument -canAsynchronouslyWriteToURL::: never called
  • Next by thread: Re: NSDocument -canAsynchronouslyWriteToURL::: never called
  • Index(es):
    • Date
    • Thread