Re: NSArrayController and retainCount
Re: NSArrayController and retainCount
- Subject: Re: NSArrayController and retainCount
- From: Steve Moore <email@hidden>
- Date: Thu, 4 Nov 2004 15:44:10 -0700
Hi Scott,
Thanks for the link, though unfortunately I do not have a subclass of
NSWindowController. Nevertheless, I'll see if the workaround is
applicable.
I had missed connecting 2 enabled bindings on the staffController, so
it actually has a retain count of 45 when the nib is loaded. If I look
at the staffController in the nib, I've got 37 "bindings" attached to
it for values and enabled states. Then I'm assuming I get one retain
for MyDocument's ivar, and maybe another retain for the array that it's
bound to as well. That runs me up to 39 retains altogether, a shortage
of 6 retains.
Similarly, with the locumsController I've got 6 value and enabled
bindings on it. I'll give it another for MyDocument's ivar, and
another for the array that it is bound to. That gives it 8, a shortage
of 2 retains.
I'm hoping, if your workaround is not workable in this situation, that
I am not going to have to go through all these objects and do a
removeObserver... on them. That would be a drag.
A rather simple question: if I release the window that contains all
these objects with binding connections to my controller will all those
"removeObserver..." calls be made by the various controls as they get
deallocated, thus reducing the retainCount on the NSArrayControllers?
I guess I can check that out.
Somehow, this all seems kind of silly. Am I not seeing things
correctly?
Later,
Steve.
On Nov 4, 2004, at 3:14 PM, Scott Stevenson wrote:
On Nov 4, 2004, at 10:43 AM, Steve Moore wrote:
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?
Hi Steve,
I only had time to glance at your email, but I think think your issue
and a workaround is described here.
http://theobroma.treehouseideas.com/document.page/18
- Scott
_______________________________________________
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
_______________________________________________
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