• 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: Leaking Memory
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Leaking Memory


  • Subject: Re: Leaking Memory
  • From: Angela Brett <email@hidden>
  • Date: Tue, 21 Jan 2003 19:15:11 +1300

At 10:50 PM -0500 20/1/2003, David Cairns wrote:
I know what I wrote wasn't _exactly_ up to par, and I _do_ know all about reference counts and NSAutorelease pools, et al; I was only trying to spare the original poster of the question with a way to use cocoa in a basic manner. I know that when I began in cocoa last august or so, memory management was the one thing that I was still confused about in November.

No offense, but being inaccurate (even if it's supposed to make it easier for someone to understand) just makes things more difficult when people learn the truth. Simplifications are fine, but only if they're actually accurate. I remember so many times in school where we were taught something one year and then told the next year to forget what we'd learnt because it was a simplification which wasn't accurate. Perhaps the reason you were still confused about memory management in November was that somebody told you that release deallocates an object, while the book* says otherwise.

If somebody is told that -release deallocates an object right a way, or that it is called using release(), they will believe that and then get confused when told that it's not the case. The true meaning of retain and release is not too complicated, and it does need to be properly understood even for writing simple beginners' applications, so it may as well be spelled out to begin with. Some people who have been told how retain and release really work might not quite understand it at first, and might think that release deallocates an object straight away - but telling them that's right is not going to help at all. The truth is always easier to understand than a simplification like that, because sooner or later you have to un-learn the simplification and learn the truth anyway, so why not learn it from the start?

Well that's my rant for the day. ;^) Note that this email was not intended to be an an attack on David in any way, it's just my views on education.

* The Objective-C Programming Language, which is installed with the developer tools and should be the first thing anyone who wants to learn Cocoa with Objective-C reads.
--
Angela Brett email@hidden http://acronyms.co.nz/angela
"We must believe in free will, we have no choice!" -- Isaac Bashevis Singer
_______________________________________________
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.
References: 
 >Re: Leaking Memory (From: David Cairns <email@hidden>)

  • Prev by Date: NSTextView and font sizes?
  • Next by Date: Re: 'AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER' redefined warning
  • Previous by thread: Re: Leaking Memory
  • Next by thread: Leaking Memory
  • Index(es):
    • Date
    • Thread