Re: ARC and IBOutlet - strong vs weak......
Re: ARC and IBOutlet - strong vs weak......
- Subject: Re: ARC and IBOutlet - strong vs weak......
- From: Clark Cox <email@hidden>
- Date: Sat, 05 Dec 2015 07:13:09 -0800
> On Dec 4, 2015, at 12:05, Mike Throckmorton <email@hidden> wrote:
>
> Quincey Morris Friday, December 4, 2015 10:04 AM
>
>> That sounds like a definitive answer. So you’re asking us because … why?
>
> Definitive for the leading question, but not the secondary:
>
>> If strong, do I need to set the outlets to nil in the corresponding dealloc method?
>
> I had tested this and it appeared as if I did not need to nil out the reference at dealloc (this makes sense) but is it an on purpose behaviour that is supported by the ARC implementation or is it some side effect that may go away?
>
> Most likely the former, but who likes to leave potential down the road a** biters lying around.
Strong instance variables are automatically released on deallocation. There is no need to set them to nil in dealloc (in fact, if all your dealloc is doing is setting instance variables to nil, I would recommend not having a dealloc method at all).
_______________________________________________
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