Chapter 6
Blocks
One of the overall goals of Objective-C is to reduce the effort necessary to program complex applications through the use of object-oriented concepts, which can help to simplify and clarify the relationship between programming entities. In this chapter, you will learn how to create and use blocks, a syntactical feature that makes the language much easier and more expressive.
A block is a piece of code that can be passed around to other parts of the application, without the need to create a separate function, method, or class. Moreover, a block not only retains information about the code contained in it, but also about the variables that were in scope right at the time that the block was created. In this way, blocks are ...
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.
Read now
Unlock full access