Re: NSDocument and Large File Import?
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