Thursday, February 28, 2013

Leak-Free Recursive Blocks

Jeremy W. Sherman (via Romain Briche):

So you need both a strong and a weak reference to your block. And the block needs to be stored in the strong reference first, so you anchor it to this world.

And you also have to make sure that the strong reference outlives the recursion. ARC makes easy things easy, but…

Jeff Biggus wrote macro to simplify this.

Comments RSS · Twitter

Leave a Comment