Re: How to keep things alive in Arc?
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