• 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: Autosave + non-file URL's == trouble
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Autosave + non-file URL's == trouble


  • Subject: Re: Autosave + non-file URL's == trouble
  • From: Charles Srstka <email@hidden>
  • Date: Sun, 21 Jun 2015 17:02:47 -0500

On Jun 21, 2015, at 3:13 PM, Quincey Morris <email@hidden> wrote:
>
> On Jun 21, 2015, at 13:02 , Charles Srstka <email@hidden <mailto:email@hidden>> wrote:
>>
>> How do you guys deal with non-file URLs and autosave?
>
> I guess the first question to ask is what makes you think that non-file URLs are usable with NSDocument at all? I don’t see the restriction documented, but there are plenty of APIs in Cocoa that take NSURLs but require them to be file URLs.

I’ve used NSDocument with non-file URLs for years, just not with autosave. (I really, really wish that autosavesInPlace were an instance method instead of a class method, so I could just have it return true conditionally upon the URL being a file URL, but oh well.)

As far as the official documentation goes:

- NSDocument’s documentation is riddled with snippets saying things like "For backward binary compatibility with OS X v10.3 and earlier, the default implementation of this method instead invokes <some older API> if it is overridden and the URL uses the file: scheme.” If *all* URLs were supposed to be using the file: scheme, that distinction would be irrelevant.

- The framework itself has a bunch of console warnings like "writeSafelyToURL:ofType:forSaveOperation:error: must be overridden for your application to support non-'file:' URLs.” that get logged if you use non-file URLs without setting up all the appropriate infrastructure in your app first.

Charles

_______________________________________________

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


  • Follow-Ups:
    • Re: Autosave + non-file URL's == trouble
      • From: Uli Kusterer <email@hidden>
    • Re: Autosave + non-file URL's == trouble
      • From: Quincey Morris <email@hidden>
References: 
 >Autosave + non-file URL's == trouble (From: Charles Srstka <email@hidden>)
 >Re: Autosave + non-file URL's == trouble (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Autosave + non-file URL's == trouble
  • Next by Date: Re: Autosave + non-file URL's == trouble
  • Previous by thread: Re: Autosave + non-file URL's == trouble
  • Next by thread: Re: Autosave + non-file URL's == trouble
  • Index(es):
    • Date
    • Thread