• 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: Newbie question: forcing data format during saveDocumentTo:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie question: forcing data format during saveDocumentTo:


  • Subject: Re: Newbie question: forcing data format during saveDocumentTo:
  • From: Jerry <email@hidden>
  • Date: Tue, 2 Sep 2003 13:11:27 -0700

Thanks for the info - I'm getting very close.

The one thing that is missing is that when the user selects Export, I do _not_ want the native type to be an option. If I hide the popup with the file types, it defaults to the native, even if I call setRequiredFileType: on the NSSavePanel and set the extension to rtf.

I can work around it as long as there is only one format for export, but it is likely that I will want to add .txt as an export format. I suppose I can dig through the default accessory view and modify the menu myself, but that seems like the kind of thing that would break on subsequent OS releases. I suppose a better approach is to create my own accessory view, but I have not found any reference or protocol definition that tells me when and how the accessory view in a NSSavePanel interacts with the rest of the system. My best guess is that I need to subclass NSSavePanel and override didEndSheet:returnCode:contextInfo:

It seems like there should be more of a relationship between NSSavePanel's setRequiredFileType: and the file types defined in info.plist, but as far as I can tell they are completely independent.

Again, thanks for your help so far. Perhaps now all I need is an example of an accessory view in the save panel.

Jerry

On Saturday, August 30, 2003, at 11:22 PM, Scott Anguish wrote:

On Aug 29, 2003, at 7:03 PM, Jerry wrote:

While I can work around this, I think I'm missing something. What
determines the document type sent to dataRepresentationOfType:?


You can specify the types of data you can save as "write-only" types.

You use the NSExportableAs to specify types that your documents can write, but not read in the Document types portion of the project's Info.plist (look at listing 2 on this page <http://developer.apple.com/documentation/Cocoa/Conceptual/Documents/ Concepts/DocTypePList.html#//apple_ref/doc/uid/20000024>

Read <http://developer.apple.com/documentation/Cocoa/Conceptual/Documents/ Tasks/FAQ.html> which discusses a bunch of relevant issues to this.

Also, the Sketch example uses the NSExportableAs key to export IFF and EPS images. So you might want to look there.

You can only "export" when you do a Save-as... and these additional types will show up in the panel then.
_______________________________________________
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.
_______________________________________________
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: Newbie question: forcing data format during saveDocumentTo:
      • From: Scott Anguish <email@hidden>
  • Prev by Date: Re: colorspace for grayscale images
  • Next by Date: Re: Enough with the newbie C questions!
  • Previous by thread: Re: question
  • Next by thread: Re: Newbie question: forcing data format during saveDocumentTo:
  • Index(es):
    • Date
    • Thread