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

Setting a documents file type during save as=8 5


  • Subject: Setting a documents file type during save as=8 5
  • From: Jonathan Wight <email@hidden>
  • Date: Tue, 13 Jan 2004 13:51:53 -0600

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.

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).

I was tempted to call -[NSDocument setFileType:] from the file type
pop-up menu's action method but then realised that would apply to the
document even if the user cancelled the save (or if the save operation
was a 'save-to').

I was also thinking of overriding -[NSDocument
saveDocumentWithDelegate:didSaveSelector:contextInfo:] and/or
-[NSDocument
saveToFile:saveOperation:delegate:didSaveSelector:contextInfo:] but
that would involve creating my own NSSavePanel and doing on the whole
way too much work for such a simple problem.

Has anyone encountered this before?

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: mmalcolm crawford <email@hidden>
  • Prev by Date: Re: Controlling NSTextView's ruler accessory view
  • Next by Date: Re: iChat "Sort by..." animation
  • Previous by thread: Re: [help!] a strange crash (to me) [SOLVED, i think]...
  • Next by thread: Re: Setting a documents file type during save as=8 5
  • Index(es):
    • Date
    • Thread