Objective C Blocks: Summary, Syntax & Best Practices
Matt Nunogawa stashed this in iOS
Stashed in: Software!, ObjectiveC, Development
From the article:
Blocks are closures for C, Objective C and C++. You may know them lambda functions.
Good usage of blocks is an excellent path to reducing typing, line count and bug count in your Cocoa programs.
Blocks should not be confused with Grand Central Dispatch (GCD): GCD is primarily a queue library, which typically uses blocks.
Blocks do have a learning curve attached to them. They also have a tremendously wonky syntax. Buyer beware: in simple situations, blocks are very readable, but excessively nested blocks can transform your source into inscrutable rivers of punctuation and indentation.
more discussion here: http://news.ycombinator.com/item?id=6127371
Thanks Matt. Those are some beautiful blocks.
8:18 AM Jul 30 2013