• 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: ARC
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ARC


  • Subject: Re: ARC
  • From: Jens Alfke via Cocoa-dev <email@hidden>
  • Date: Fri, 23 Aug 2019 17:27:00 -0700


> On Aug 23, 2019, at 2:17 PM, Casey McDermott via Cocoa-dev
> <email@hidden> wrote:
>
> After we finished, the controller for our main window started being
> deallocated some random time after launch.
> Apparently the erroneous strong references were keeping it alive.

AppKit delegates, like NSWindow.delegate, are unsafe-unretained references;
this might be giving you trouble.

> We allocate the controller in our app delegate class. It's a member but
> apparently that is not a
> strong enough reference, so the controller is released at the end of the
> scope.

A member variable is a strong reference by default, so that should suffice to
keep it alive. Is your app delegate itself being dealloced?

—Jens
_______________________________________________

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: ARC
      • From: Turtle Creek Software via Cocoa-dev <email@hidden>
References: 
 >ARC (From: Casey McDermott via Cocoa-dev <email@hidden>)

  • Prev by Date: Re: ARC
  • Next by Date: Re: ARC
  • Previous by thread: Re: ARC
  • Next by thread: Re: ARC
  • Index(es):
    • Date
    • Thread