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: Bill Cheeseman <email@hidden>
- Date: Sun, 06 Jul 2008 11:25:41 -0400
- Thread-topic: Guidelines for Cocoa frameworks supporting garbage collection?
on 2008-07-06 9:49 AM, Jean-Daniel Dupas at email@hidden wrote:
> If __strong is so dangerous, why is it used in Cocoa (see NSDrawer,
> NSDateFormatter, NSNumberFormatter, NSKeyedArchiver, NSURL, ) ?
Those are interesting examples, especially NSDrawer.
In NSDrawer, only the CFRunLoopTimerRef and CFRunLoopObserverRef iVars are
given the __strong keyword, while the CFRunLoopRef iVar is not. This
suggests to me that some very refined thinking is going on as to when to use
or not to use the __strong keyword. I wish I knew what all the relevant
considerations were.
In NSURL, the void *_reserved iVar is given the __strong keyword, which
doesn't tell us much since _reserved may not be used at all. Ditto
NSKeyedArchiver.
In NSDateFormatter, a CFDateFormatterRef iVar is given the __strong keyword.
This seems consistent with your point, but I am still haunted by the fact
that NSDrawer's CFRunLoopRef iVar is not given the __strong keyword. Ditto
NSNumberFormatter.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
www.quecheesoftware.com
PreFab Software - www.prefabsoftware.com
_______________________________________________
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