on 16/04/02 02:00, Jim Witte at jswitte_at_bloomington.in.us wrote:
>> Second, Obj-C is not garbage-collected, and its reference counting
>> scheme is slow and insufficient for even Apple's own needs (Apple
>> violates reference counting internally
>
> Is the reference counting automatic, or does the programmer have to
> explicitly invoke it (is that how Apple gets away with not doing it)?
It's manual. Everytime you allocate an object, or specifically 'retain' it,
you have to release it when you're done with it. You can use the
'autorelease' feature, where an object will be kept around until the chain
of command returns the the application object. The object then receives a
release message. If it's reference counting comes to 0, the object will
automatically receive a 'dealloc' message and will have to release all
memory it retains.
It's not perfect, specially in race conditions, but it's pretty simple.
-Laurent.
-- ===================================================================== Laurent Daudelin <http://home.cox.rr.com/nemesys> Logiciels Nemesys Software mailto:nemesys_at_cox.rr.comcode monkey n.: 1. A person only capable of grinding out code, but unable to perform the higher-primate tasks of software architecture, analysis, and design. Mildly insulting. Often applied to the most junior people on a programming team. 2. Anyone who writes code for a living; a programmer. 3. A self-deprecating way of denying responsibility for a management decision, or of complaining about having to live with such decisions. As in "Don't ask me why we need to write a compiler in COBOL, I'm just a code monkey."
-- Read the List FAQ/Etiquette: http://www.newtontalk.net/faq.html Read the Newton FAQ: http://www.guns-media.com/mirrors/newton/faq/ This is the NewtonTalk mailing list - http://www.newtontalk.net
This archive was generated by hypermail 2.1.2 : Sun May 05 2002 - 14:03:53 EDT