How do blocks work in ARC?
Blocks “just work” when you pass blocks up the stack in ARC mode, such as in a return. You don’t have to call Block Copy any more. You still need to use [^{} copy] when passing “down” the stack into arrayWithObjects: and other methods that do a retain.
The one thing to be aware of is that NSString * __block myString is retained in ARC mode, not a possibly dangling pointer. To get the previous behavior, use __block NSString * __unsafe_unretained myString or (better still) use __block NSString * __weak myString.
Mit MRC muss der Block kopiert werden, wenn er den lokalen Kontext verlässt, in dem er erzeugt wurde, also wenn er zum Beispiel von einer Methode zurückgeben wird.
Typically, you shouldn’t need to copy (or retain) a block. You only need to make a copy when you expect the block to be used after destruction of the scope within which it was declared. Copying moves a block to the heap.
You can copy and release blocks using C functions:
Block_copy();
Block_release();
To avoid a memory leak, you must always balance a Block_copy() with Block_release().