Posts in blocks

Objective-C Blocks Caveat

I like blocks. I really do. It’s been at least two years now I’ve been using them and I still make syntax mistakes, but I like them.

Recently I had a long discussion with my colleagues and friends about the use of self inside blocks. I can hear [you][8] saying: “C'mon dude, it’s sooo straightforward and ridiculous!”. I’m sure there are some subtle things to consider about the __weak and the __strong qualifiers for self inside blocks.

written in blocks, ios, objective-c Read on →

Objective-C Blocks Under the Hood

Recently I was asked to describe the ‘under the hood’ memory management of variable and objects in blocks. I think that in 2013 almost every iOS dev knows the practical usage and effect of putting the __block keyword before the declaration of a variable, but maybe what’s happening for real is not so straightforward.

written in blocks, ios, objective-c Read on →