Re: ARC, blocks, capture variables
Re: ARC, blocks, capture variables
- Subject: Re: ARC, blocks, capture variables
- From: Quincey Morris <email@hidden>
- Date: Sun, 27 Sep 2015 18:03:27 -0700
- Feedback-id: 167118m:167118agrif8a:167118sGY9JgRGVV:SMTPCORP
On Sep 27, 2015, at 17:17 , Scott Ribe <email@hidden> wrote:
>
> But I know that it does not result in a retain cycle, because I nil out fun at the appropriate time. So how to get rid of the warning?
IIRC you can simply assign ‘self’ to a local variable just before assigning to ‘fun', and use the local variable name instead of ‘self’ inside the block.
The other approach I’ve used, when I have control the signature of the block, is to pass ‘self’ as a parameter to the block invocation. This may actually avoid the reference cycle completely.
_______________________________________________
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