Class

# ObjCBlock

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

Used when callings declares that require Obj-C blocks. An <span class="title-ref">ObjCBlock</span> is created from a Delegate and in turn creates an Objective-C block that will call into the delegate. This Objective-C block is retrieved from the Handle property and passed into declares.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                       | Type                                        | Read-Only | Shared |
|----------------------------|---------------------------------------------|-----------|--------|
| `Handle<objcblock.handle>` | `Ptr</api/data_types/additional_types/ptr>` | ✓         |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                  | Parameters                                                       | Returns | Shared |
|---------------------------------------|------------------------------------------------------------------|---------|--------|
| `Constructor<objcblock.constructor0>` | theDelegate As `Object</api/data_types/additional_types/object>` |         |        |

## Property descriptions

<div id="objcblock.handle">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

ObjCBlock.Handle

**Handle** As `Ptr</api/data_types/additional_types/ptr>`

> Gets the Objective-C block.
>
> This property is read-only.

## Method descriptions

<div id="objcblock.constructor0">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

ObjCBlock.Constructor

**Constructor**(theDelegate As `Object</api/data_types/additional_types/object>`)

> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> `Constructors</api/language/constructor>` are special methods called when you create an object with the `New</api/language/new>` keyword and pass in the parameters above.
>
> </div>
>
> Used to supply the delegate to create for the block.

## Compatibility

|                       |                               |
|-----------------------|-------------------------------|
| **Project Types**     | Console, Desktop, Mobile, Web |
| **Operating Systems** | iOS, macOS                    |

<div class="seealso">

`Object</api/data_types/additional_types/object>` parent class; `Declare</api/language/declare>` command, `Ptr</api/data_types/additional_types/ptr>` data type

</div>
