On Fri, 6 Feb 2015 12:46:44 -0800, Jens Alfke said:

>Come to think of it, I'm surprised that AppKit delegates are still
>unsafe-unretained. Why haven't these been converted to safe weak
>references yet?

The 'why' has been answered, but worse it's not even clear sometimes what a 
delegate's situation is.  Take NSTableView.h in the 10.10 SDK:

-------------
/* Get and set the delegate. The delegate can implement methods in the protocol 
NSTableViewDelegate. All delegate methods are optional. The delegate is a weak 
reference (non retained) in non garbage collected applications. Under garbage 
collected apps, it is a strong reference. The default value is 'nil'.
 */
- (void)setDelegate:(id <NSTableViewDelegate>)delegate;
- (id <NSTableViewDelegate>)delegate;
-------------

So based on Greg saying "We prefer to reserve the term 'weak' for safe zeroing 
weak." I guess for NSTableView there's no need to nil the delegate.  OTOH, my 
experience converting my GC app to ARC says the exact opposite.  Without 
clearing the delegate to nil in say windowWillClose, I get sporadic crashes.

What's the true situation for NSTableView?

Cheers,

-- 
____________________________________________________________
Sean McBride, B. Eng                 s...@rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to