• 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: How to defer NSDocument:writeToFile:ofType ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to defer NSDocument:writeToFile:ofType ?


  • Subject: Re: How to defer NSDocument:writeToFile:ofType ?
  • From: "Erik M. Buck" <email@hidden>
  • Date: Fri, 25 Jan 2002 13:03:04 -0600

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

Called after the user has been given the opportunity to select a destination
through the modal save panel presented by
runModalSavePanelForSaveOperation:delegate:didSaveSelector:contextInfo:. If
fileName is non-nil, this method writes the document to fileName, sets the
document's file location and document type (if a native type), and clears
the document's edited status. didSaveSelector gets called with YES if the
document is saved successfully, and NO otherwise.
didSaveSelector should have the following signature:

- (void)document:(NSDocument *)doc didSave:(BOOL)didSave contextInfo:(void
*)contextInfo

in you NSDocument subclass.

You could also catch the -save: and -saveAs: actions and hadle them
yourself.

You could use a modal sheet instead of a drawer.

----- Original Message -----

  • Follow-Ups:
    • Re: How to defer NSDocument:writeToFile:ofType ?
      • From: Manfred Lippert <email@hidden>
    • Re: How to defer NSDocument:writeToFile:ofType ?
      • From: Manfred Lippert <email@hidden>
References: 
 >How to defer NSDocument:writeToFile:ofType ? (From: Manfred Lippert <email@hidden>)

  • Prev by Date: Re: Intercepting keystrokes system-wide
  • Next by Date: Re: How can I standardize a path name? (Cocoa solution wanted)
  • Previous by thread: How to defer NSDocument:writeToFile:ofType ?
  • Next by thread: Re: How to defer NSDocument:writeToFile:ofType ?
  • Index(es):
    • Date
    • Thread