NSArrayController and retainCount
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