• 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: NSDocument's -close method calls itself?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDocument's -close method calls itself?


  • Subject: Re: NSDocument's -close method calls itself?
  • From: Quincey Morris <email@hidden>
  • Date: Thu, 2 Jul 2009 11:52:10 -0700

On Jul 2, 2009, at 10:34, Sean McBride wrote:

I'm trying to find somewhere to undo what was done in my NSDocument
subclass' initializer. Specifically, to start/stop KVO observation. It
seemed like 'close' would be a good place.

'close' isn't a good place, because it isn't necessarily called. If you look at the Leopard Developer Release Notes:


	http://developer.apple.com/releasenotes/Cocoa/AppKit.html

in the section entitled "Advice for Overriders of Methods that Follow the delegate:didSomethingSelector:contextInfo: Pattern", you'll find a nice little code snippet that happens to show you where to place code that should execute just before a document closes:

if (shouldClose) {
// Here we can do all sorts of things with this document that's about to be closed.
}

Does that help?


_______________________________________________

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: NSDocument's -close method calls itself?
      • From: "Sean McBride" <email@hidden>
References: 
 >NSDocument's -close method calls itself? (From: "Sean McBride" <email@hidden>)

  • Prev by Date: Windows on main thread always only sometimes?
  • Next by Date: Re: NSTableView bug?
  • Previous by thread: NSDocument's -close method calls itself?
  • Next by thread: Re: NSDocument's -close method calls itself?
  • Index(es):
    • Date
    • Thread