Re: NSTableView is messaging zombie delegate
Re: NSTableView is messaging zombie delegate
- Subject: Re: NSTableView is messaging zombie delegate
- From: Sean McBride <email@hidden>
- Date: Mon, 09 May 2016 08:23:21 -0400
- Organization: Rogue Research Inc.
On Fri, 6 May 2016 13:28:10 -0700, Jens Alfke said:
>> On May 6, 2016, at 1:03 PM, Matthew LeRoy <email@hidden> wrote:
>>
>> My understanding is that NSTableView's delegate is a zeroing weak reference
>
>Are you sure? Historically it’s been unsafe_unretained — in the old days
>before weak references or ARC, the view never retained nor released the
>delegate. The type of crash you’re having was a not-uncommon bug.
>
>Apple may have upgraded the property to a proper zeroing weak reference,
>but I can’t tell from the docs.
I was going to say "no", because my bug's still open, but in fact I never filed one. :( The following are still "open" (including their duped-to originals) though:
24046976 / 21380125 NSSplitView's delegate should be weak not assign
21366070 / 18987740 NSAnimation delegate should be 'weak' not 'assign'
17553217 NSSpeechRecognizer delegate should be 'weak' not 'assign'
17540574 NSToolbar's delegate should be 'weak' not 'assign'
17540533 NSWindow's delegate should be 'weak' not 'assign'
15301393 / 10520557 Support zeroing weak references (under ARC) with NSTextView
As for NSMenu, it came back: "Although the delegate is declared “assign” in NSMenu.h, it’s actually been weak (for weak-compatible objects) since 10.9."
When switching from GC to ARC, all this was a PITA.
Cheers,
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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