• 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: document types with NSDocument framework
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: document types with NSDocument framework


  • Subject: Re: document types with NSDocument framework
  • From: "Simson Garfinkel" <email@hidden>
  • Date: Fri, 23 Nov 2001 22:25:02 -0500

I think that I have an answer to my own question, but I still don't have a
*good* answer

If you subclass MyDocument, and you do a saveDocument: without a filename,
the following methods will be called in this order"

- (void)runModalSavePanelForSaveOperation:(NSSaveOperationType)saveOperation
delegate:(id)delegate didSaveSelector:(SEL)didSaveSelector contextInfo:(void
*)contextInfo

- (BOOL)prepareSavePanel:(NSSavePanel *)savePanel

- (void)saveToFile:(NSString *)fileName
saveOperation:(NSSaveOperationType)saveOperation
delegate:(id)delegate didSaveSelector:(SEL)didSaveSelector
contextInfo:(void *)contextInfo

- (NSString *)fileTypeFromLastRunSavePanel


So here is what you do:

1. Subclass prepareSavePanel:(NSSavePanel *)savePanel so that your aux view
is inserted into the SavePanel.

2. Subclass fileTypeFromLastRunSavePanel to return the file type that the
user choose.

3. Make sure that - (NSData *)dataRepresentationOfType:(NSString *)aType
handles the type.

I'd still like to see how this is done automatically, the way that the
Sketch application obviously does.

Anybody have any clues?


  • Prev by Date: Disabling selecting another cell
  • Next by Date: Re: Rotating NSImage in NSImageView
  • Previous by thread: document types with NSDocument framework
  • Next by thread: Disabling selecting another cell
  • Index(es):
    • Date
    • Thread