Re: alloc/release confusion
Re: alloc/release confusion
- Subject: Re: alloc/release confusion
- From: Sherm Pendley <email@hidden>
- Date: Fri, 13 Feb 2009 20:15:22 -0500
On Fri, Feb 13, 2009 at 7:55 PM, Boon Chew <email@hidden> wrote:
>
> How do I go about knowing whether a method like show would do the retain?
You don't *need* to know whether other objects retain their arguments. They
follow the same rules your own objects follow, so if they do retain it, it's
their responsibility to release it when they're done with it.
The reference doc doesn't say it. Also, what if it doesn't?
It doesn't matter if it does or doesn't - your own responsibilities are
exactly the same either way.
> Is there a way in Cocoa to find out the reference count of an object (for
> debugging purposes)?
If you're looking at he reference count for debugging purposes, you're doing
it wrong. That path leads to further confusion, not fixed bugs.
You really need to read this: <
http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/MemoryMgmt.html
>
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
_______________________________________________
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