Blocks are language-level feature that added to C, Objective-C and C++, which
provides you to create distinct segments
of code that can be passed to methods or
functions as if they were values. Blocks are Objective-C objects, so we can add
it to collections like NSArray or NSDictionary. Blocks can capture
values from the enclosing scope,so this features make blocks similar to closures or lambdas in
other programming languages such as java and c#.
Markdown for AI
A clean, structured version of this page for AI assistants and LLMs.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
Blocks are language-level feature that added to C, Objective-C and C++, which provides you to create distinct segments of code that can be passed to methods or functions as if they were values. Blocks are Objective-C objects, so we can add it to collections like NSArray or NSDictionary. Blocks can capture values from the enclosing scope,so this features make blocks similar to closures or lambdas in other programming languages such as java and c#.