Thursday, February 28, 2013 [Tweets] [Favorites]

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

Stay up-to-date by subscribing to the Comments RSS Feed for this post.

Leave a Comment