• 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 and Large File Import?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDocument and Large File Import?


  • Subject: Re: NSDocument and Large File Import?
  • From: Mike Abdullah <email@hidden>
  • Date: Thu, 20 Jun 2013 23:12:55 +0100

On 20 Jun 2013, at 20:52, Karl Moskowski <email@hidden> wrote:

>
> On Jun 20, 2013, at 3:44 PM, Jens Alfke <email@hidden> wrote:
>
>> Yup, it’s an untitled document so it doesn’t have a persistent manifestation yet.
>>
>> A typical solution for your problem is to create a temporary directory somewhere (using the APIs for that purpose) and treat that as the document’s storage. Then on first save you can move that to where you were told to save (which might have to involve a copy-then-delete.)
>>
>> An important detail is that if the document is closed without saving, you should remember to delete the temporary directory, otherwise you’ve just eaten up part of the user’s available disk space until the next reboot.
>
> Thanks, Jens.
>
> If we have to do that level of manual work, I think our preferred direction will be to go the Xcode-style route, and ask for a save location early. However, I’ll ask my colleagues for their opinions.
>
> Anyway, would the best place to implement either of these approaches be in a NSDocumentController subclass or in the NSDocument subclass?

There should be no need to do this. If you need a location on disk for the document, just trigger an autosave so that the system effectively creates a temp location for you to use (-[NSDocument autosavedContentsFileURL])


_______________________________________________

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: NSDocument and Large File Import?
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: UIDocument + NSFileWrapper crashes on opening
  • Next by Date: Re: NSDocument and Large File Import?
  • Previous by thread: Re: NSDocument and Large File Import?
  • Next by thread: Re: NSDocument and Large File Import?
  • Index(es):
    • Date
    • Thread