Re: Question about NSTreeController/NSOutlineView instance cleanup
Re: Question about NSTreeController/NSOutlineView instance cleanup
- Subject: Re: Question about NSTreeController/NSOutlineView instance cleanup
- From: Markus Spoettl <email@hidden>
- Date: Thu, 10 Apr 2008 19:46:18 -0700
The first thing to check is how you are initializing the treeContent
variable. What method are you using to create it, and are you
retaining it?
OK, this is what I do:
- (id)init
{
self = [super init];
if (self) {
treeContent = [[NSMutableArray alloc] init];
}
return self;
}
- (void)dealloc
{
[treeContent release];
[super dealloc];
}
I thought I don't have to retain treeContent since I automatically do
that with alloc-init, right?
When treeContent is released, I assume it automatically releases all
TreeNode objects in it and that's what is reported in the log entry to
be unexpected. I get as many warnings as root node entries in
treeContent but none for child objects further down the hierarchy.
Markus
--
__________________________________________
Markus Spoettl
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden