Re: if statement causing 32 Byte leak?
Re: if statement causing 32 Byte leak?
- Subject: Re: if statement causing 32 Byte leak?
- From: Alex Kac <email@hidden>
- Date: Sat, 9 Jan 2010 19:58:40 -0600
It seems pretty simple to me. Read the memory management rules. It explains pretty clearly what you own. That’s all that you care about. You don’t care if its autoreleased or not. You just care whether you own it or not. If you own it, you release it when you’re done. If you don’t own it, you let it be or gain ownership and then release it when you’re done.
On Jan 9, 2010, at 7:52 PM, Mr. Gecko wrote:
> I know about memory management, but I don't know how I can tell what is autorelease or not. Is there a way to like says isAutorelease for testing? And you still didn't answer my question about string, data and so on, all I need is a yes or no.
>
> On Jan 9, 2010, at 7:41 PM, Graham Cox wrote:
>
>>
>> On 10/01/2010, at 12:35 PM, Mr. Gecko wrote:
>>
>>> I just looked and saw that, so one question. Is array, string, and data all the same as new or are those autorelease?
>>
>>
>> As Joar said:
>>
>>> From the memory management guide:
>>>
>>> "You take ownership of an object if you create it using a method whose
>>> name begins with “alloc” or “new” or contains “copy” (for example, alloc, newObject,
>>> or mutableCopy), or if you send it a retain message."
>>
>>
>> As far as I can see, 'new' begins with 'new'. Therefore you already own it.
>>
>> --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
Alex Kac - President and Founder
Web Information Solutions, Inc.
"Forgiveness is not an occasional act: it is a permanent attitude."
-- Dr. Martin Luther King
_______________________________________________
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