• 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
Want notification that Document will Close
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Want notification that Document will Close


  • Subject: Want notification that Document will Close
  • From: Jerry Krinock <email@hidden>
  • Date: Fri, 29 Jan 2010 07:13:20 -0800

I want a notification that a document will close in order to do clean-up such as:

1.  Clear my intra-app copy/drag collections of any items in the closing doc.
2.  Unbind temporary bindings which I had bound in code.
3.  Cancel NSURLConnections which may send messages to the doc.

I've been using -[NSDocument close], but in its documentation I read that "This method may not always be called".   I've not experienced this.  When might it not be called?  [1]

I cannot use -[NSWindow close] because I'm developing a framework which is used in both an app and a background tool.  The latter opens documents but, of course, no windows.

As always, the -dealloc method may be too late to avoid crashes.

Not using Garbage Collection.

Thank you,

Jerry Krinock

[1]  It also says that "Additional information on application termination can be found in [another document] Graceful Application Termination."  But I read the other document but did not find the answer, and also I'm interested in what happens when the document closes without application termination.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Want notification that Document will Close
      • From: "Sean McBride" <email@hidden>
    • Re: Want notification that Document will Close
      • From: Mike Abdullah <email@hidden>
  • Prev by Date: Re: Hot to define a connection from source code?
  • Next by Date: Re: Fuzzy Focus Ring
  • Previous by thread: Re: FSEventStreamCreate and File System Events Wierdness
  • Next by thread: Re: Want notification that Document will Close
  • Index(es):
    • Date
    • Thread