• 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: Setting a documents file type during save as=8 5
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Setting a documents file type during save as=8 5
      • From: "Louis C. Sacha" <email@hidden>
References: 
 >Setting a documents file type during save as=8 5 (From: Jonathan Wight <email@hidden>)
 >Re: Setting a documents file type during save as=8 5 (From: mmalcolm crawford <email@hidden>)

  • Prev by Date: Re: How to completely release every object allocated when opening a NIB file ?
  • Next by Date: Re: vImage
  • Previous by thread: Re: Setting a documents file type during save as=8 5
  • Next by thread: Re: Setting a documents file type during save as=8 5
  • Index(es):
    • Date
    • Thread