Re: Guidelines for Cocoa frameworks supporting garbage collection?
Re: Guidelines for Cocoa frameworks supporting garbage collection?
- Subject: Re: Guidelines for Cocoa frameworks supporting garbage collection?
- From: "Shawn Erickson" <email@hidden>
- Date: Sun, 6 Jul 2008 09:25:36 -0700
On Sun, Jul 6, 2008 at 9:05 AM, Jean-Daniel Dupas
<email@hidden> wrote:
> I think the rule may be:
> use __strong for retained/copied ivars, and nothing for assigned ivars.
> There is no equivalent of zeroing ref, but weak ref are really common in
> Cocoa. For example, delegate are not retain. the Notification center does
> not retain observers, and the drawer probably does not retain the runloop.
The reason delegates and observers aren't retained it to avoid retain
cycles. In a GC world cycles aren't a problem (cycle with no roots
will be collected). As a result ivars to delegates and observers, etc.
can (and some do IIRC) use strong references.
-Shawn
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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