Re: NSTreeController and object retain counts

2009-11-09 Thread Mads Paulin
Hi, What I initally did was exactly to log from the dealloc method of my node class. Experiencing that it never got called, I started to log from retain and release to try to get deeper into the problem. I stumbled on the problem when integrating some C++ code into my cocoa project. Every

Re: NSTreeController and object retain counts

2009-11-09 Thread Andy Lee
On Nov 9, 2009, at 8:16 AM, Mads Paulin wrote: What strikes me as odd is that all Nodes in the document array are created and removed directly via the add and remove actions on the treecontroller. - I dont have a single "external" access to these objects. I would hence expect the controller

Re: NSTreeController and object retain counts

2009-11-09 Thread Mads Paulin
Hi Andy, Thank you for your input. I did actually try to exchange the OutlineView with a TableView and the TreeController with an ArrayController and the problem went away meaning that all elements in the collection was correctly dealloced when calling remove:sender on the controller. What strik

Re: NSTreeController and object retain counts

2009-11-09 Thread Andy Lee
On Nov 9, 2009, at 6:31 AM, Mads Paulin wrote: Hi, Yes my Document class releases the array in its dealloc method and all Node objects in the array are properly dealloc'ed when deallocing the document. However, I think the problem is unrelated to the retaining of the array member of the

Re: NSTreeController and object retain counts

2009-11-09 Thread Graham Cox
On 09/11/2009, at 10:31 PM, Mads Paulin wrote: Adding a node object through this method creates a node object in the document array member with a retain count of 2. The remove:sender method correctly removes the object from the document's array but only decrements the node object's retain c

Re: NSTreeController and object retain counts

2009-11-09 Thread Mads Paulin
Hi, Yes my Document class releases the array in its dealloc method and all Node objects in the array are properly dealloc'ed when deallocing the document. However, I think the problem is unrelated to the retaining of the array member of the document class but rather to the retaining of elements a

Re: NSTreeController and object retain counts

2009-11-08 Thread Greg Guerin
Mads Paulin wrote: #import @interface MyDocument : NSDocument { NSMutableArray *array; } @property (readonly) NSMutableArray* array; @end All I changed in the doc impl is @synthesize array and array =[ [NSMutableArray]alloc init]; in the init method. Does your MyDocument implemen

Re: NSTreeController and object retain counts

2009-11-08 Thread Mads Paulin
Hi, will do.. not much to it though: The document class header: #import @interface MyDocument : NSDocument { NSMutableArray *array; } @property (readonly) NSMutableArray* array; @end All I changed in the doc impl is @synthesize array and array =[ [NSMutableArray]alloc init]; in the

Re: NSTreeController and object retain counts

2009-11-08 Thread Greg Guerin
Mads Paulin wrote: ... big description ... Can't debug descriptions. Post your code. -- GG ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at c

NSTreeController and object retain counts

2009-11-08 Thread Mads Paulin
Hi All, I am working on integrating a NSOutlineView and NSTreeController into my application and have bumped into some problems related to objects not being release when remove from the NSTreeController. I have boiled the problem down to the following very basic setup - working in a non-g