I read the __ block variables documentation and thought about cases when I use __block. It seems to me that I need this in two cases:
- To mark a variable as read and write when used in a block
- To avoid saving loops when accessing yourself inside a block
On the surface, it does not look like these two things are connected. I believe that __block variables are not saved as yet another trick that I need to remember for the specific case of using avoiding save cycles.
I am wondering if there is a more important architectural reason why they cannot be kept? I would have thought that another keyword to indicate this might be clearer so as not to mix the two functions listed above.
update -
I should mention that this is code that does not use ARC. Now I see that __block variables are actually stored in ARC.
source share