Skip to Main Content
Learning Objective-C 2.0: A Hands-On Guide to Objective-C for Mac and iOS Developers
book

Learning Objective-C 2.0: A Hands-On Guide to Objective-C for Mac and iOS Developers

by Robert Clair
July 2010
Beginner content levelBeginner
416 pages
9h 51m
English
Addison-Wesley Professional
Content preview from Learning Objective-C 2.0: A Hands-On Guide to Objective-C for Mac and iOS Developers

16. Blocks

Blocks provide a way to package up some executable code and a context (various variables) as a single entity so they can be handed off for execution at a later time or on a different thread. In other languages, blocks or similar constructs are sometimes called closures or anonymous functions. Blocks are an Apple-supplied extension to C, Objective-C2.0, and C++. Apple has submitted blocks to the C standards working group as a proposed extension to C. At the time of this writing, blocks are only available on Mac OS X Snow Leopard (v 10.6 and on iOS 4). They are not available on earlier versions of Mac OS X or iPhone iOS.

Note

You can use blocks on iPhone OS 3.x and on Mac OS X Leopard (v 10.5) if you install Plausible Blocks (PLBlocks). ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Objective-C 2.0: A Hands-on Guide to Objective-C for Mac and iOS Developers, Second Edition

Learning Objective-C 2.0: A Hands-on Guide to Objective-C for Mac and iOS Developers, Second Edition

Robert Clair
Beginning iPhone Development with Swift 2: Exploring the iOS SDK

Beginning iPhone Development with Swift 2: Exploring the iOS SDK

David Mark, Kim Topley, Jack Nutting, Frederik Olsson, Jeff LaMarche
More iPhone Development with Objective-C

More iPhone Development with Objective-C

David Mark, Jayant Varma, Jeff LaMarche, Alex Horovitz, Kevin Kim
Objective-C for Absolute Beginners: iPhone, iPad and Mac Programming Made Easy

Objective-C for Absolute Beginners: iPhone, iPad and Mac Programming Made Easy

Stefan Kaczmarek, Brad Lees, Gary Bennett, Mitch Fisher

Publisher Resources

ISBN: 9780321712110Purchase book