<!--
{
  "availability" : [
    "iOS: 3.0.0 -",
    "iPadOS: 3.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.6.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ObjectiveC",
  "identifier" : "/documentation/ObjectiveC/objc_constructInstance",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Objective-C Runtime"
    ],
    "preciseIdentifier" : "c:@F@objc_constructInstance"
  },
  "title" : "objc_constructInstance"
}
-->

# objc_constructInstance

Creates an instance of a class at the specified location.

```
extern idobjc_constructInstance(Class cls, void *bytes);
```

## Parameters

`cls`

The class that you want to allocate an instance of.

`bytes`

The location at which to allocate an instance of the `cls` class. `bytes` must point to at least `class_getInstanceSize(cls)` bytes of well-aligned, zero-filled memory.

## Return Value

An instance of the class `cls` at `bytes`, if successful; otherwise `nil` (for example, if `cls` or `bytes` are themselves `nil`).

## Discussion

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)