Re: ^Block statement considered harmful for callbacks?
Re: ^Block statement considered harmful for callbacks?
- Subject: Re: ^Block statement considered harmful for callbacks?
- From: Seth Willits <email@hidden>
- Date: Thu, 25 Apr 2013 16:33:27 -0700
On Apr 25, 2013, at 1:32 PM, Oleg Krupnov wrote:
> All in all I come to personally find delegates more elegant and honest than blocks for callbacks. Am I alone here? :)
Possibly. :)
> I always find it more difficult to read code with blocks, because it takes me an effort to understand the context the code will ge running in, across the block scope. Now if you add the necessity to think about retain cycles, it's pretty much a nightmare.
I don't know… I don't have any trouble with it. Perhaps it's with how often you're using a particular pattern but I use blocks wherever appropriate and raaaarely run into a retain cycle, and the context/scope thought process seems trivial to me.
I've only been skimming through this entire thread, but just to throw it out there, perhaps you could post a specific real-world use case where it's more trouble than it's worth; I'm thinking maybe you might be able to avoid the retain cycles etc by tweaking your interfaces rather than just thinking about memory management. I know one (of the only two I can think of) cases where I had a retain cycle in a block, I ended up tweaking the interface for an unrelated reason and it worked that retain cycle right out as a side effect.
*shrug*
Just a thought.
--
Seth Willits
_______________________________________________
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