NSOutlineView retaining/releasing data cell
NSOutlineView retaining/releasing data cell
- Subject: NSOutlineView retaining/releasing data cell
- From: Darrin Cardani <email@hidden>
- Date: Thu, 27 May 2004 10:48:06 -0500
I'm seeing something I don't understand. I have an NSOutlineView, and
I've subclassed NSTableColumn to create a custom column so I can put
different types of data cells in it for each row. One of the cells is
a custom cell I've implemented myself, and it creates an NSArray of
NSImages when it is initialized. However, the custom NSCell's dealloc
method is getting called too soon, and I can't figure out why.
I've overridden the custom NSCell's retain and release methods to see
what's happening, and it looks like NSOutlineView is doing an extra
release at the end of its mouseDown: method. (Or rather,
NSTableView's mouseDown: method. According to the stack trace
NSOutlineView calls NSTableView's mouseDown: method at some point and
that's the one doing the apparent extra release.)
When I first create the cell, I retain it. When the NSTableColumn is
deallocated, then I release the cell. Other than that, I'm not
retaining or releasing the cell at all. It seems like NSOutlineView
should be retaining the cell one extra time before it starts its
mouseDown functionality. But clearly if it were a bug in
NSOutlineView, I wouldn't be the only one seeing the problem. :-) So
what am I missing? Where else do I need to be retaining the cell?
Thanks,
Darrin
--
Darrin Cardani - email@hidden
President, Buena Software, Inc.
<
http://www.buena.com/>
Video, Image and Audio Processing Development
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.