• 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: UIDocument + NSFileWrapper, how to get incremental saving to work?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UIDocument + NSFileWrapper, how to get incremental saving to work?


  • Subject: Re: UIDocument + NSFileWrapper, how to get incremental saving to work?
  • From: Quincey Morris <email@hidden>
  • Date: Sat, 24 Aug 2013 11:07:09 -0700

On Aug 24, 2013, at 06:15 , Markus Spoettl <email@hidden> wrote:

> It seems no matter what I do, I can't get incremental saving to work. The more sub-wrappers my package wrapper contains, the longer it takes for the document to get saved. It doesn't matter how many sub-wrappers actually changed, the time it takes to save increases with the number of wrappers.
>
> The documentation in UIDocument's -writeContents:toURL:forSaveOperation:originalContentsURL:error: helpfully states that if one wants incremental saving, one has to implement it there. I took that to mean that UIDocument's use of NSFileWrapper doesn't support incremental saving for some reason.

The file wrapper optimization is not, AFAIK, regarded as incremental saving, though the intended effect is of course somewhat similar.

> So I went and implemented my own -writeContents::::: that essentially calls the root package wrapper's -writeToURL:options:originalURL:error:. This method's documentation states that it implements incremental saving by using hard links for unchanged content. Still, the performance is unchanged compared to UIDocument's own implementation.

What file wrapper are you returning from 'contentsForType:error:'? Are you constructing it there? If so, that might explain why all the files are being re-written.

Normally, you'd keep track of the file wrapper originally passed to 'loadFromContents:ofType:error:', and return *that* at save time, after replacing the sub-wrappers for any files that have changed. Using that approach, I've never run into a problem with the hard-linking optimization for unchanged files.

_______________________________________________

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: UIDocument + NSFileWrapper, how to get incremental saving to work?
      • From: Markus Spoettl <email@hidden>
References: 
 >UIDocument + NSFileWrapper, how to get incremental saving to work? (From: Markus Spoettl <email@hidden>)

  • Prev by Date: Re: Issues with NSTextView Attachments
  • Next by Date: Exception After Adding a WebView to a NIB
  • Previous by thread: UIDocument + NSFileWrapper, how to get incremental saving to work?
  • Next by thread: Re: UIDocument + NSFileWrapper, how to get incremental saving to work?
  • Index(es):
    • Date
    • Thread