Re: Importing to core data persistent document
Re: Importing to core data persistent document
- Subject: Re: Importing to core data persistent document
- From: Kyle Sluder <email@hidden>
- Date: Wed, 4 Aug 2010 20:17:23 -0700
On Aug 4, 2010, at 7:48 PM, Gideon King <email@hidden> wrote:
> I think maybe my explanation could be clearer. Here's the flow:
>
> 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"];
Ouch, this sounds like a bad idea. I would expect -fileURL to return something meaningful after -readFromURL:ofType:error:.
Have you thought of putting this conversion logic in a subclass of NSDocumentController instead? That way you don't violate NSDocument's expectation of being associated with the file it was opened from.
--Kyle Sluder_______________________________________________
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