Re: Importing to core data persistent document
Re: Importing to core data persistent document
- Subject: Re: Importing to core data persistent document
- From: Quincey Morris <email@hidden>
- Date: Wed, 4 Aug 2010 20:25:16 -0700
On Aug 4, 2010, at 20:18, Quincey Morris wrote:
> On Aug 4, 2010, at 19:48, Gideon King wrote:
>
>> 1. User initiates import of file of type "fred"
>> 2. I pick that up in -readFromURL:ofType:error:, and spawn a process which converts files of type "fred" to type "myfiletype", the native file type of the application. Let's say that it is stored in a file called /MyImports/file.mytype.
>> 3. Still in -readFromURL:ofType:error:, I call super, telling it to load the converted file, and then call [self setFileURL:nil]; [self setFileType:@"myfiletype"];
>
> I don't have any answers, but I was going to contribute some questions, then I realized that I don't quite understand the above. Apologies if you explained this in your original post.
>
> What's the mechanism that gets to step 1 in the above -- File | New? File | Open? File | Import? (Meaning, by the first two, the standard actions that get dispatched to NSDocumentController.)
>
> I assumed, from your statement that readFromURL:ofType:error: is invoked, that this was coming from a File | Open of the file to be converted. Is the file needing conversion a Core Data store? Or a non-Core Data file of some kind? (If the latter, I'm not sure why you think its safe to use NSPersistentDocument.)
One other preliminary question:
Am I correct in assuming that the intention of setting fileURL to nil is to (in effect) make the imported document untitled, so that the user will be asked for a location to save it, at the next save?
_______________________________________________
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