Re: Importing to core data persistent document

2010-08-04 Thread Gideon King
Thanks Quincey - of course I can do exactly what you say - pick up the fact that they are importing right at the start, ask them where they want the converted file, put it there and open it. Simple and foolproof. Sometimes I can't see the wood for the trees! setFileURL:nil always worked before,

Re: Importing to core data persistent document

2010-08-04 Thread Quincey Morris
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

Re: Importing to core data persistent document

2010-08-04 Thread Gideon King
Answers: 1. It could come from a File/Open, or them opening that file from the Finder, or from a File/Import command (the import one just calls the document controller's openDocumentWithContentsOfURL:display:error anyway, so they all go through the same mechanism) 2. The file needing conversion

Re: Importing to core data persistent document

2010-08-04 Thread Gideon King
Yes, I did think of putting it elsewhere, but I would have thought the problem would be the same. Say I overrode the NSDocumentController openDocumentWidhContentsOfURL:ofType:error: and had that do the conversion to my native document type, then call the NSDocumentController implementation, it

Re: Importing to core data persistent document

2010-08-04 Thread Quincey Morris
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

Re: Importing to core data persistent document

2010-08-04 Thread Quincey Morris
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

Re: Importing to core data persistent document

2010-08-04 Thread Kyle Sluder
On Aug 4, 2010, at 7:48 PM, Gideon King 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",

Re: Importing to core data persistent document

2010-08-04 Thread Gideon King
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 i

Importing to core data persistent document

2010-08-04 Thread Gideon King
Hi, I'm having trouble importing into my application using Core Data. I have an NSAtomicStore based storage system. I can open and save my own files, but when someone wants to import from another format, I want to load the file and set the file name to nil so that I can save it as my own file ty