Using blocks which captures self (explicitly or automatically by referencing an iVar!) you have the chance to a retain cycle where the block keeps self and self keeps the block or a crash when self is released. This is true for Obj-C as well as for Swift. The proper usage declared by Apple itself: store […]
Category: Closure pattern
Blocks in Objective-C
Blocks in Objective-C Quick overview Blocks are the closure pattern implementation in Objective-C. Blocks are objects containing code like a method but blocks are standalone objects (not belonging to a specific class/instance) encapsulating and capturing the code and variables enclosed in the beginning and closing brackets. You declare a block type or variable this way: returnType […]