@bbum covers blocks in depth in a blog post and touches on the __block storage type.
__block is a distinct storage type
Just like static, auto, and volatile, __block is a storage type. It tells the compiler that the variable’s storage is to be managed differently.
...
However, for __block variables, the block does not retain. It is up to you to retain and release, as needed.
...
As for use cases you will find __block
is sometimes used to avoid retain cycles since it does not retain the argument. A common example is using self.
//Now using myself inside a block will not
//retain the value therefore breaking a
//possible retain cycle.
__block id myself = self;