Re: Setting a documents file type during save as=8 5
Re: Setting a documents file type during save as=8 5
- Subject: Re: Setting a documents file type during save as=8 5
- From: Jonathan Wight <email@hidden>
- Date: Tue, 13 Jan 2004 15:51:21 -0600
On Jan 13, 2004, at 15:42, mmalcolm crawford wrote:
>
On Jan 13, 2004, at 11:51 AM, Jonathan Wight wrote:
>
>
> In my NSDocument's -prepareSavePanel method I'm adding a pop-up menu
>
> to
>
> allow the user to select the format to save the document as.
>
>
>
Is there any reason why the alternate options are not presented
>
automatically?
>
If you want to support write-only formats, look for NSExportableAs.
>
<http://developer.apple.com/documentation/Cocoa/Conceptual/Documents/
>
Tasks/FAQ.html> etc.
The problem with that method is that not all the types I support will
be present in my Application Info.plist. I have plug-in based
exporters.
>
> However I'm unsure where to make the changes necessary to actually
>
> change the file type during the method that physically writes the file
>
> (-[NSDocument writeToFile:ofType:] in this case).
>
>
>
You shouldn't change the type in that method -- you're given the type
>
as one of the parameters...
What I ended up doing is setting/resetting a flag in - [NSDocument
saveToFile:saveOperation:delegate:didSaveSelector:contextInfo:] and
then checking for that flag in: -[NSDocument
writeWithBackupToFile:ofType:saveOperation:] and if set then called
[super writeWithBackupToFile:...] with a different type.
Fine until I find a better solution (although I like the idea of AppKit
generating my popup menu for me).
Cheers.
Jon.
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.