Copying blocks (ie: copying them to instance variables) in Objective-C

后端 未结 4 1310
[愿得一人]
[愿得一人] 2020-12-08 21:31

I\'m trying to understand blocks. I get how to use them normally, when passed directly to a method. I\'m interested now in taking a block, storing it (say) in an instance va

4条回答
  •  执念已碎
    2020-12-08 21:51

    There were a very nice presentation on that subject on recent WWDC (2010). It described how blocks were implemented and why you need to use Block_copy. You can download a movie from the presentation at: http://developer.apple.com/itunes/?destination=adc.apple.com.4092414566 The movie is called: "Advanced Objective-C and garbage collection"

提交回复
热议问题