in Technology by

What are blocks and how are they used?

Please log in or register to answer this question.

1 Answer

0 votes
by

Blocks are a language-level feature added to C, Objective-C and C++, which allow you to create distinct segments of code that can be passed around to methods or functions as if they were values.

The syntax to define a block literal uses the caret symbol (^), like this:

^{

NSLog(@”This is a block”);

}

Related questions

...