RE: [Newbie Q] Memory Management in Cocoa
RE: [Newbie Q] Memory Management in Cocoa
- Subject: RE: [Newbie Q] Memory Management in Cocoa
- From: "Jonathan E. Jackel" <email@hidden>
- Date: Tue, 5 Nov 2002 18:12:28 -0500
>
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 ;)
I've always liked the dog-leash metaphor. Imagine a dog. If you want to
walk the dog you put a leash on his collar. But the dog is very popular.
Any number of people can "retain" the dog by adding any number of leashes.
When each person is tired of walking the dog, he/she releases the leash.
When the last person let's go of the last leash, the dog is "freed".
Jonathan
_______________________________________________
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.