Re: Nib ownership and retain count
Re: Nib ownership and retain count
- Subject: Re: Nib ownership and retain count
- From: "Hamish Allan" <email@hidden>
- Date: Thu, 24 Jan 2008 21:30:04 +0000
On Jan 24, 2008 8:48 PM, Ian was here <email@hidden> wrote:
> >From what I gathered from the documentation, the
> returned array of top level objects are autoreleased,
> meaning that they would need to be retained by the
> array containing them.
This is a misreading of the documentation, which states that the
returned array (not the objects within it) is autoreleased.
Your code:
> [topLevelNibObjects copy];
causes all the objects in the array to have their retain count
increased (which is why you need that makeObjectsPerformSelector:
call), but does not keep a reference to the copy, and the original
array, which is autoreleased (as per the documentation) is dealloced
next time round the run loop (though by chance you seem to be getting
away with it when you send it a message in your dealloc).
It's not clear to me how this relates to the problem with your object,
but what is clear to me is that you're too happy to try to "work
around" memory management issues, without understanding *why* you're
having them, so I'd hazard a guess that your problem is caused by not
understanding how some other part of your code affects your object's
life cycle.
Hamish
_______________________________________________
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