> On 23 Aug 2019, at 2:17 pm, Casey McDermott via Cocoa-dev 
> <cocoa-dev@lists.apple.com> wrote:
> 
> 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. What is best practice to hold a strong reference on it until the app 
> closes?

I suppose you haven't redeclared your ivars as "modern"-style properties (using 
`@property` syntax), huh?  I'd recommend taking the time to do so. This will 
make ownership obvious (via the  `strong`/`weak` keywords) and you'll get the 
appropriate retention by just assigning to the property. It'll also let you 
delete vast swaths of boilerplate accessor code (presuming your code base is of 
the vintage I'm guessing it is).

b

_______________________________________________

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
  • ARC Casey McDermott via Cocoa-dev
    • Re: ARC Alex Zavatone via Cocoa-dev
    • Re: ARC Ben Kennedy via Cocoa-dev
    • Re: ARC Alex Zavatone via Cocoa-dev
      • Re: ARC Turtle Creek Software via Cocoa-dev
    • Re: ARC Jens Alfke via Cocoa-dev
      • Re: ARC Turtle Creek Software via Cocoa-dev
        • Re: ARC Gary L. Wade via Cocoa-dev
        • Re: ARC Jens Alfke via Cocoa-dev
          • Re: ARC Turtle Creek Software via Cocoa-dev
            • Re: ARC Jean-Daniel via Cocoa-dev
              • Re: ARC Turtle Creek Software via Cocoa-dev
                • Re: ARC Uli Kusterer via Cocoa-dev

Reply via email to