• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: The right place for an importer in the document architecture
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >The right place for an importer in the document architecture (From: Gideon King <email@hidden>)

  • Prev by Date: Re: CFRunLoopStop exception
  • Next by Date: Re: What gets automatically localized?
  • Previous by thread: The right place for an importer in the document architecture
  • Next by thread: "Toll free" bridge from NSAttributedString * to CFAttributedStringRef
  • Index(es):
    • Date
    • Thread