• 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: another releasing related question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: another releasing related question


  • Subject: Re: another releasing related question
  • From: "I. Savant" <email@hidden>
  • Date: Wed, 18 Apr 2007 12:59:06 -0400

On 4/18/07, Jay <email@hidden> wrote:
This is the code I used to send out notifications, THE QUESTION is, should I release the pointer A? Since I created it at first, and according to the reference for NSDictionary, each object added to the dictionary receives a "retain" message, in order to prevent it from deallocated before the dictionary is through with it. In this way, should I release it or just leave it alone?

This can be confusing. Class factory/convenience methods create instances of that class (sometimes with passed parameters, sometimes not). It is understood that they're generally autoreleased (unless otherwise stated).

 Again, the documentation I referred you to will help (did you read
it?). The first bullet point therein answers your question directly
... if your concern doesn't match the rules that say you're
responsible for releasing the object, then it's simply not a concern.

--
I.S.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: 
 >another releasing related question (From: "Jay" <email@hidden>)

  • Prev by Date: What is "-fobjc-exceptions" anyway?
  • Next by Date: Re: What is "-fobjc-exceptions" anyway?
  • Previous by thread: Re: another releasing related question
  • Next by thread: What is "-fobjc-exceptions" anyway?
  • Index(es):
    • Date
    • Thread