• 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: [Newbie Q] Memory Management in Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Newbie Q] Memory Management in Cocoa


  • Subject: Re: [Newbie Q] Memory Management in Cocoa
  • From: Ondra Cada <email@hidden>
  • Date: Wed, 6 Nov 2002 00:11:08 +0100

On Wednesday, November 6, 2002, at 12:11 , Jonathan E. Jackel wrote:

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"...

...and runs away, never to be seen anymore ;)

Yup, and -- what's IMHO important here -- you operate the leash precisely the same way regardless you bred the beast from a puppy or just added your leash recently.
---
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.
  • Prev by Date: Re: [Newbie Q] Memory Management in Cocoa
  • Next by Date: Re: [Newbie Q] Memory Management in Cocoa
  • Previous by thread: Re: [Newbie Q] Memory Management in Cocoa
  • Next by thread: Cocoa equivalent to Javadoc?
  • Index(es):
    • Date
    • Thread