<!--
{
  "availability" : [
    "DriverKit: -",
    "iOS: -",
    "iPadOS: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "DriverKit",
  "identifier" : "/documentation/DriverKit/OSDictionary/removeObject-156jh",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "DriverKit"
    ],
    "preciseIdentifier" : "c:@S@OSDictionary@F@removeObject#*1C#"
  },
  "title" : "removeObject"
}
-->

# removeObject

Remove an object by key from the dictionary.

```
void removeObject(const char *aKey);
```

## Parameters

`aKey`

A c-string key. An OSString is created from aKey and used as the key for the dictionary.

## Discussion

An object in the dictionary with the given key object is removed and released.

---

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)