0
What are blocks and how are they used?

Open 1 Answers 21 Views Technology

What are blocks and how are they used?

1 Answer

0

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”);

}

by (304k points)
...