• 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: Manual KVO quirks with NSDocument and NSWindowController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Manual KVO quirks with NSDocument and NSWindowController


  • Subject: Re: Manual KVO quirks with NSDocument and NSWindowController
  • From: Tim Lucas <email@hidden>
  • Date: Tue, 24 May 2005 01:03:41 +1000

On 23/05/2005, at 10:50 PM, Andrew White wrote:
The first is that the window controller's version of observeValueForKeyPath:ofObject:change:context: is called twice during the call to [self didChangeValueForKey: @"interestingData"]. This doesn't break the app, but is an interesting feature.

You don't need the willChange and didChange if you're using auto KVO notification, you get that for free.


The second is that when I close the window (and thus the document) I get an error:

2005-05-23 22:33:40.770 ProgramName[3584] An instance 0x118dc50 of class MyDocument is being deallocated while key value observers are still registered with it. Break on _NSKVODeallocateLog to start debugging.

According to the debugger, "close" is called for DeviceConfigDoc but "dealloc" is not. I did have code in MyWindowController to stop observing when the window controller's dealloc was called, but it doesn't seem to be called. I searched for a NSWindowController documentWillClose message, but there doesn't seem to be one. Nor can I find a "windowDidClose" notification - the closest I found was "close", and that doesn't seem to be called either when I click the close box.

My guess would be to find the culprit causing dealloc not to be called... that's your main problem.


- tim

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Manual KVO quirks with NSDocument and NSWindowController
      • From: Andrew White <email@hidden>
References: 
 >Manual KVO quirks with NSDocument and NSWindowController (From: Andrew White <email@hidden>)

  • Prev by Date: Re: RAM Location and Size in 64bits Machines
  • Next by Date: Re: Object References in Obj-C
  • Previous by thread: Re: Manual KVO quirks with NSDocument and NSWindowController
  • Next by thread: Re: Manual KVO quirks with NSDocument and NSWindowController
  • Index(es):
    • Date
    • Thread