Re: Help with Basics
Re: Help with Basics
- Subject: Re: Help with Basics
- From: Rob Ross <email@hidden>
- Date: Tue, 23 Nov 2010 17:41:16 -0800
It's not nonsense, although Jain's description is a little too loose.
Rephrased : "If you obtain an object using a method containing the words alloc, copy, or new, *you* are responsible for releasing the object, otherwise you are not responsible and the object will be auto-released."
That's a true statement, and a very useful one to remember. Of course, as you said there's more to memory management than just *who* is responsible for releasing an object, but it's a huge part of memory management. I think calling it nonsense is a bit too extreme.
Rob
On Nov 23, 2010, at 5:23 PM, Graham Cox wrote:
>
> On 24/11/2010, at 3:42 AM, Rounak Jain wrote:
>
>> "If you allocate an object using alloc, you need to take responsibility for releasing it when you’re done.
>> However, if class methods are used, then there is no need to worry about releasing objects because they are auto-released."
>
>
> This is nonsense. If the memory management rules could be boiled down to this statement, there wouldn't be a need to have a whole chapter devoted to it.
>
> Read the memory management rules, and learn them.
>
> http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/MemoryMgmt/MemoryMgmt.html
>
>
> --Graham_______________________________________________
_______________________________________________
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