On Nov 30, 2005, at 8:45 PM, Shawn Erickson wrote:
Garbage collection is not yet supported on Mac OS X 10.4 (likely a
framework issue more then runtime library) but Apple is working on
it,
why finalize showed up in NSObject. I doubt you will see it become
supported before 10.5 (assuming it become supported in 10.5).
See the gcc manpage:
-fobjc-gc
Enable garbage collection (GC) for Objective-C objects.
The
resulting binary can only be used on Mac OS X 10.5
(Leopard) and
later systems, due to additional functionality needed in
the (NeXT)
Objective-C runtime.
When the -fobjc-gc switch is specified, the compiler
will replace
assignments to instance variables (ivars) and to certain
kinds of
pointers to Objective-C object instances with calls to
interceptor
functions provided by the runtime garbage collector.
Two type
qualifiers, "__strong" and "__weak", also become
available. The
"__strong" qualifier may be used to indicate that
assignments to
variables of this type should generate a GC interceptor
call, e.g.:
__strong void *p; // assignments to 'p' will
have interceptor calls
int *q; // assignments to 'q'
ordinarly will not
...
(__strong int *)q = 0; // this assignment
will call an interceptor
Conversely, the "__weak" type qualifier may be used to
suppress
interceptor call generation:
__weak id q; // assignments to 'q' will
not have interceptor calls
id p; // assignments to 'p' will
have interceptor calls
...
(__weak id)p = 0; // suppress interceptor
call for this assignment