• 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: How to keep things alive in Arc?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to keep things alive in Arc?


  • Subject: Re: How to keep things alive in Arc?
  • From: Dave <email@hidden>
  • Date: Mon, 09 May 2016 12:17:38 +0100

Hi,

Well if “thing” is used only within the method you don’t have to do anything - ARC will keep it alive until the local you have assigned it to goes out of scope. If you want to use use it beyond the scope of the local method/object but not return it from the method, then assign it to a “strong” property, which keeps it alive until the object that owns the property is dealloc’ed.

ARC will automatically take care of the case where that returns an object too, but of course the same rules apply for the local scope of the method that calls the method that returns the object.

Hope this helps.
Dave




_______________________________________________

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: How to keep things alive in Arc?
      • From: Roland King <email@hidden>
References: 
 >How to keep things alive in Arc? (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Re: discontiguous bounds ?
  • Next by Date: Re: How to keep things alive in Arc?
  • Previous by thread: Re: How to keep things alive in Arc?
  • Next by thread: Re: How to keep things alive in Arc?
  • Index(es):
    • Date
    • Thread