> 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