Re: ^Block statement considered harmful for callbacks?
Re: ^Block statement considered harmful for callbacks?
- Subject: Re: ^Block statement considered harmful for callbacks?
- From: Tom Davie <email@hidden>
- Date: Thu, 25 Apr 2013 11:45:16 +0100
On 25 Apr 2013, at 11:40, Diederik Meijer | Ten Horses <email@hidden> wrote:
> I don't agree, blocks are very powerful.
>
> I am using Xcode 4.6 and in a project that uses ARC it was throwing warnings when a block reference to a property caused a retain cycle. This is how I found it and why I mentioned it in another thread in the first place.
>
> I haven't tested it extensively, but it looks as if the compiler recognises these situations easily and then tells you about it.
>
> So I wouldn't call blocks dangerous at all…
You're right – the compiler *is* detecting some simple cases, as I suggested! Note – this does not make throwing blocks around without paying attention to retain cycles inherently safe though, the compiler can not statically infer all potential cycles.
Thanks
Tom Davie
_______________________________________________
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