Re: Handling unpresented files with NSDocument
Re: Handling unpresented files with NSDocument
- Subject: Re: Handling unpresented files with NSDocument
- From: "email@hidden" <email@hidden>
- Date: Thu, 04 Aug 2016 11:11:24 +0700
> On Aug 3, 2016, at 11:04 PM, Jerome Krinock <email@hidden> wrote:
>
>
>> On 2016 Aug 03, at 07:56, email@hidden wrote:
>>
>> can CoreData solve this?
>
> If you are using Core Data for other reasons, then you should consider using BSManagedDocument, and you should read the discussion of saving and copying “additional content”, (which would be your audio files), which I had last year:
>
> https://github.com/karelia/BSManagedDocument/issues/45
>
> But if you are not already using Core Data in this app for other reasons, I don’t think it offers much more than NSDocument for your issue, and with the additional complexity, you probably don’t want Core Data.
Hey Jerome! Very similar issue you had there! I was thinking about dropping the duplicate feature but I’m close to solving it with my current approach (which is also using the FileManager to copy the files around).
If your interested: I force an auto save onto the duplicated document (which is a copy of the old one without the audio files) and then copy all the audio files from the original into the auto save. When the user then saves the duplicate, I copy the files from the autosave to the new user-defined destination. The only problem right now is intercepting the function where the app automatically deletes the autosaves so can safely copy before that happens. Haven’t found that yet.
I don’t think using CoreData will be to any value to me when I look at my current design. The NSDocument can very well handle all the objects inside my app. So I don’t use CoreData. But I thought maybe it's able to manage the audio files for me when duplicating or reverting the document or moving it to iCloud. But reading through the CoreData getting started guide gave me no such clues.
Thanks for your input! I guess I’ll keep working on my current approach then.
> _______________________________________________
>
> 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
_______________________________________________
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