Re: NSTabViewItem and NSViewController
Re: NSTabViewItem and NSViewController
- Subject: Re: NSTabViewItem and NSViewController
- From: Keary Suska <email@hidden>
- Date: Thu, 04 Apr 2019 08:01:52 -0600
Who owns the view controller? Apparently, no-one, sine ARC is deallocating it
once the last reference to it (the tab view item) is deallocated. If there is
supposed to be an owner, make sure the owner’s reference is strong. If you can
target 10.10+, using NSTabViewController is probably a better choice.
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
> On Apr 4, 2019, at 7:43 AM, Casey McDermott <email@hidden> wrote:
>
> We have a tab view with tabs added from code. Each tab uses a NSTabViewItem
> subclass,
> which contains a reference to a NSViewController subclass within it to manage
> tab contents.
> Users click to add and remove tabs.
>
> It works fine without ARC, with the NSTabView controlling the viewer lifetime.
> With ARC, it works fine with one tab. However the view controller is
> released and deallocated
> when a second tab is added, so switching tabs causes a crash from the invalid
> reference.
>
> Is there some way to see what is releasing the view controller? It's
> nothing in our code.
> NSTabView seems the likeliest culprit?
>
> NSTabViewItem is not a NSView subclass. Does that prevent it from managing
> lifetime for a view and view controller?
>
> Thanks,
>
> Casey McDermott
> Turtle Creek Software
> _______________________________________________
>
> 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
_______________________________________________
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