On Jun 29, 2013, at 10:00 AM, Kyle Sluder <k...@ksluder.com> wrote:

> In the first case, the block context captured the _value_ of a. In the
> second, it captured the _pointer to b's movable storage_.

That's a nice example, because it also focuses on the *other* practical aspect 
of __block, namely that it causes the value to be "live" in the block. This is 
often used, for example, in a one-time notification, to capture the observer 
token returned by creating the notification, and in the block, to use that 
token to remove the same observer - all in what amounts to one line of code.

I like the verbal distinction between capturing the value and pointing at the 
storage; I think that's where I need to go. It shows why __block both lets you 
modify the value and keeps the value live in the block; they are really just 
the same thing. Thx! m.

--
matt neuburg, phd = m...@tidbits.com, http://www.apeth.net/matt/
pantes anthropoi tou eidenai oregontai phusei
Programming iOS 6! http://shop.oreilly.com/product/0636920029717.do
RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
TidBITS, Mac news and reviews since 1990, http://www.tidbits.com


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to