How to wire up document exporting?
How to wire up document exporting?
- Subject: How to wire up document exporting?
- From: Charles Jenkins <email@hidden>
- Date: Wed, 28 Jan 2015 19:16:26 -0500
To save my app’s native document format, I overrode NSDocument’s fileWrapperOfType:error:. I have assumed that the reason I produce data something else actually writes out is because the OS has security features, and a sandboxed app is not allowed to create arbitrary files on the filesystem.
I need to have a File > Export command to save the document in OpenXML format. I’ve done some research in the Developer Library, and the best clues I’ve found so far are in the Sketch app. Sketch manages multiple output types by overriding NSDocument’s dataOfType:error: and paying attention to the requested type name. Somehow that gets called by saveDocumentTo:
My app needs to work more like Pages, by presenting a dialog confirming export options before the OpenXML file is generated. I can see where I might have to do this by overriding saveDocumentTo: so my options dialog will appear and eventually dataOfType:error: will be called. But I’m worried that dataOfType and fileWrapperOfType can’t both be used???
Am I on the right track here, or is there some other path Export menu items should take?
—
Charles Jenkins
_______________________________________________
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