• 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: Cocoa-dev Digest, Vol 4, Issue 123
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa-dev Digest, Vol 4, Issue 123


  • Subject: Re: Cocoa-dev Digest, Vol 4, Issue 123
  • From: Antonio Nunes <email@hidden>
  • Date: Thu, 8 Feb 2007 00:35:30 +0000

On Feb 8, 2007, at 8:13 AM, Tiger wrote:

hello everyone, I am learning the objective-C language, there is some concept that really makes me feel puzzled.
What is the difference between [release] and [dealloc]? Both of them seem to release a instance object, when should I use them ?
I really cant tell the difference from one to one.

In my understanding, and put very succinctly:
-[release] is what you use to tell the runtime you are no longer interested in an object. It does not necessarily tear down the object.
-[dealloc] is something you never call yourself, but that gets called on an object by the runtime when it's retain count reachers zero. You override it in your own objects to make sure they release any objects they may be retaining at deallocation time.


Make sure you read up on objc memory management:
<http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/ index.html>


Cheers,
António

----------------------------------------------------
There is a world of difference between
searching for happiness and choosing
to be happy.
----------------------------------------------------




_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


References: 
 >Re: Cocoa-dev Digest, Vol 4, Issue 123 (From: Tiger <email@hidden>)

  • Prev by Date: Re: release vs. dealloc
  • Next by Date: Re: dropping file issue?
  • Previous by thread: Re: release vs. dealloc
  • Next by thread: delegate issue?
  • Index(es):
    • Date
    • Thread