Hi

I have an importer to convert different file types into my native file format. 
Due to the nature of the importer process, I need to run it as a separate 
converter, so the process flow is:
1. The user selects the file to open (not in my native format)
2. The program reads it and writes out a file in my native format
3. I read the document from the native format version
4. Set the URL to nil because it is effectively a new document
5. Display the document

So I need to know where in the process I need to intercept the original file 
open request and do the conversion, and forward the request to open the 
converted file.

Would it be best to subclass NSDocumentController and override 
-makeDocumentWithContentsOfURL:ofType:error: and do the conversion, and call 
super with the new URL to the converted document, get the result back and set 
the URL to nil, and return it? 

Would there be any side effects from that (because openDocument... used a 
different URL)?

...or will I need to go back to -openDocumentWithContentsOfURL:display:error: 
and work out the file type from the extension and work from there? 

I'm assuming that anything within NSDocument or NSPersistentDocument is too 
late in the piece...
 
Thanks

Gideon




_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to