• 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: Ben Kennedy via Cocoa-dev <email@hidden>
  • Date: Fri, 23 Aug 2019 15:36:04 -0700

> On 23 Aug 2019, at 2:17 pm, Casey McDermott via Cocoa-dev
> <email@hidden> 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 (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

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