Re: The right place for an importer in the document architecture
Re: The right place for an importer in the document architecture
- Subject: Re: The right place for an importer in the document architecture
- From: Seth Willits <email@hidden>
- Date: Thu, 8 Apr 2010 13:25:24 -0700
On Apr 8, 2010, at 4:46 AM, Gideon King wrote:
> 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.
It depends on your interface. If you're offering the ability to simply "open" this type of document using the normal mechanisms like the Open menu item, or dragging the file onto the application icon, then you would add the document type to Info.plist. In the normal file reading methods, you would read from the file and convert it to your format, and set the url to nil etc.
Here's an example:
http://www.sethwillits.com/temp/DocChangeTest.zip
If you want a separate import process like using File -> Import, which does an open dialog, pick a file and it creates an untitled document, you'd just stick all of that in a normal top-level controller that does the reading, creates a new document of your native type, and sets the data on that document.
--
Seth Willits
_______________________________________________
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