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

ARC


  • Subject: ARC
  • From: Casey McDermott via Cocoa-dev <email@hidden>
  • Date: Fri, 23 Aug 2019 21:17:43 +0000 (UTC)

 We started out assuming that ARC was like Python or Java, where you could just
allocate
objects and it would manage their lifetimes automatically. Then we read about
the complexities
of ARC, and started adding __weak to upstream references.

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.

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?

BTW, one site we looked at describes ARC as "kind of like a Japanese B-horror
movie". That seems accurate.

Casey McDermott
TurtleSoft.com
_______________________________________________

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: Roland King via Cocoa-dev <email@hidden>
    • Re: ARC
      • From: Jens Alfke via Cocoa-dev <email@hidden>
    • Re: ARC
      • From: Alex Zavatone via Cocoa-dev <email@hidden>
    • Re: ARC
      • From: Ben Kennedy via Cocoa-dev <email@hidden>
    • Re: ARC
      • From: Alex Zavatone via Cocoa-dev <email@hidden>
  • Prev by Date: Re: NSLog displays inconsistent format for NSDate
  • Next by Date: Re: ARC
  • Previous by thread: Re: NSLog displays inconsistent format for NSDate
  • Next by thread: Re: ARC
  • Index(es):
    • Date
    • Thread