---
title: "What is block in objective c?"  
description: "What is block in objective c?"  
author: "Allen Scott"  
published: 2017-01-09  
updated: 2020-09-14  
canonical: https://www.mindstick.com/interview/23151/what-is-block-in-objective-c  
category: "ios"  
tags: ["objective c"]  
reading_time: 1 minute  

---

# What is block in objective c?

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#.

## Answers

### Answer by Allen Scott

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#.


---

Original Source: https://www.mindstick.com/interview/23151/what-is-block-in-objective-c

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
