• 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
NSArrayController and retainCount
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSArrayController and retainCount


  • Subject: NSArrayController and retainCount
  • From: Steve Moore <email@hidden>
  • Date: Thu, 4 Nov 2004 11:43:11 -0700

Hello,

I have an NSArrayController (staffController) instantiated in my .nib file. It is bound to an NSMutableArray in MyDocument. In MyDocument's windowControllerDidLoadNib method I checked the retainCount of the staffController (the first line in the method) and it returns a value of 43. This seems odd. I have another NSArrayController (locumsController) that returns a retainCount of 10 at the same time. What accounts for these unusually high values?

The reason I am asking is that I am getting the dreaded "An instance 0x342de0 of class MyDocument is being deallocated while key value observers are still registered with it. Break on _NSKVODeallocateLog to start debugging." message in the Run Log on application termination. When I check in MyDocument's addObserver: forKeyPath: options: context: method only these two observers (staffController and locumsController) are being added (one for key "StaffDoctors" and the other for "LocumsDoctors"). Unfortunately, when I call MyDocument's removeObserver:staffController forKeyPath:@"StaffDoctors" and a similar call for the locumsController, I still get the same message in the Run Log. Admittedly, as far as I can tell the message is nothing but a nuisance, but it bugs me to see it popping up all the time as though I am doing something horribly wrong. Any advice on how to rid myself of these messages? Or any idea on why these retainCounts are so counter-intuitive?

Thanks,
Steve Moore.
 _______________________________________________
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: NSArrayController and retainCount
      • From: Scott Stevenson <email@hidden>
  • Prev by Date: Re: catching command-enter keyDown events in a table view
  • Next by Date: Re: Meaning of NSFont italicAngle?
  • Previous by thread: Keyboard shortcuts and scroll views
  • Next by thread: Re: NSArrayController and retainCount
  • Index(es):
    • Date
    • Thread