• 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: Guidelines for Cocoa frameworks supporting garbage collection?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Guidelines for Cocoa frameworks supporting garbage collection?
      • From: "Michael Ash" <email@hidden>
References: 
 >Re: Guidelines for Cocoa frameworks supporting garbage collection? (From: Jean-Daniel Dupas <email@hidden>)

  • Prev by Date: Re: Guidelines for Cocoa frameworks supporting garbage collection?
  • Next by Date: Re: NSTableView and rows of different "type"
  • Previous by thread: Re: Guidelines for Cocoa frameworks supporting garbage collection?
  • Next by thread: Re: Guidelines for Cocoa frameworks supporting garbage collection?
  • Index(es):
    • Date
    • Thread