• 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: Graham Cox <email@hidden>
  • Date: Fri, 21 Aug 2009 20:34:03 +1000


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


  • Follow-Ups:
    • Re: When to 'release' in Cocoa management?
      • From: DairyKnight <email@hidden>
References: 
 >When to 'release' in Cocoa management? (From: DairyKnight <email@hidden>)
 >Re: When to 'release' in Cocoa management? (From: bryscomat <email@hidden>)

  • Prev by Date: Re: When do I need to override hash?
  • Next by Date: Re: Force crash a cocoa app for Crash Reporter testing
  • Previous by thread: Re: When to 'release' in Cocoa management?
  • Next by thread: Re: When to 'release' in Cocoa management?
  • Index(es):
    • Date
    • Thread