• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: When to 'release' in Cocoa management?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: When to 'release' in Cocoa management?


  • Subject: Re: When to 'release' in Cocoa management?
  • From: DairyKnight <email@hidden>
  • Date: Fri, 21 Aug 2009 20:46:55 +0800

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@hidden> 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@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

References: 
 >When to 'release' in Cocoa management? (From: DairyKnight <email@hidden>)
 >Re: When to 'release' in Cocoa management? (From: bryscomat <email@hidden>)
 >Re: When to 'release' in Cocoa management? (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: Authorization Question (Possibly a simple POSIX question?)
  • Next by Date: Re: When to 'release' in Cocoa management?
  • Previous by thread: Re: When to 'release' in Cocoa management?
  • Next by thread: core data nsarraycontroller for all entities
  • Index(es):
    • Date
    • Thread