Re: another releasing related question
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