<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ModelIO",
  "identifier" : "/documentation/ModelIO/MDLObjectContainer",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Model I/O"
    ],
    "preciseIdentifier" : "c:objc(cs)MDLObjectContainer"
  },
  "title" : "MDLObjectContainer"
}
-->

# MDLObjectContainer

A default implementation for handling object hierarchy relationships in a 3D asset.

```
class MDLObjectContainer
```

## Overview

Model I/O uses the [`MDLObjectContainerComponent`](/documentation/ModelIO/MDLObjectContainerComponent) protocol to create object hierarchy relationships for meshes, lights, cameras, and containers loaded from a [`MDLAsset`](/documentation/ModelIO/MDLAsset) instance. To create your own containers—for example, to reference in-memory representations, offline databases, or custom asset file formats—create [`MDLObjectContainer`](/documentation/ModelIO/MDLObjectContainer) subclasses and add them to a [`MDLObject`](/documentation/ModelIO/MDLObject) instance using its [`setComponent(_:for:)`](/documentation/ModelIO/MDLObject/setComponent(_:for:)) method.

All methods of this class are defined by the [`MDLObjectContainerComponent`](/documentation/ModelIO/MDLObjectContainerComponent) protocol. For discussion of these methods, see [`MDLObjectContainerComponent`](/documentation/ModelIO/MDLObjectContainerComponent).

## Relationships

### Conforms To

[`Equatable`](/documentation/Swift/Equatable)

[`MDLObjectContainerComponent`](/documentation/ModelIO/MDLObjectContainerComponent)

[`Hashable`](/documentation/Swift/Hashable)

[`NSFastEnumeration`](/documentation/Foundation/NSFastEnumeration)

[`MDLComponent`](/documentation/ModelIO/MDLComponent)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)