Thanks for the link. Guess it explains. So every call without alloc/new,
e.g. [NSMutableString stringWithString], you dont have to release the
objects yourself?



On Fri, Aug 21, 2009 at 6:34 PM, Graham Cox <[email protected]> wrote:

>
> On 21/08/2009, at 5:42 PM, bryscomat wrote:
>
> Yes. You release the object when one of three things occur:
>>
>> 1. You allocate the object yourself with the "alloc" message.
>> 2. You allocate the object yourself with the shorthand "new" message.
>> 3. You issue a retain message.
>>
>> So in both examples you gave you are required to release the object, as
>> you are responsible for it because you explicitly allocated it.
>>
>
>
> This list is incomplete.
>
> We're not supposed to rehash the memory management rules on the list, as
> invariably, they are incorrect or incomplete. What we are supposed to do is
> provide a link (yet again) to the rules:
>
>
> http://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmRules.html
>
> --Graham
>
>
>
_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to