Re: [Newbie Q] Memory Management in Cocoa
Re: [Newbie Q] Memory Management in Cocoa
- Subject: Re: [Newbie Q] Memory Management in Cocoa
- From: Ondra Cada <email@hidden>
- Date: Tue, 5 Nov 2002 23:33:06 +0100
On Tuesday, November 5, 2002, at 10:17 , Sherm Pendley wrote:
(2) you own an object that you introduced into your application
by calling alloc, allocWithZone:, copy, or copyWithZone: yourself (I'm
leaving something out here; what is it?).
retain
mutableCopy (and new).
Although, I don't think of objects that have been retained as being
"owned" by my code. The owner is whatever code allocated or copied the
object. My code is just renting the object for a while - with an option
to buy if the owner decides to release it. ;-)
I'd rather look at the object as shared. Creating it and retaining it
seems to me equivalent in the sense that both chunks of code -- the one
who alloc/init'd, and the one who retained -- have precisely the same
rights and duties so far as the object in question is concerned. If you
insist of speaking ownership, then the object has more owners at once ;)
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.