---
title: "removeObject(forKey:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsubiquitouskeyvaluestore/removeobject(forkey:)"
---

# removeObject(forKey:)

Removes the value for the specified key from the iCloud key-value store.

## Declaration

```swift
func removeObject(forKey aKey: String)
```

## Parameters

- `aKey`: The key with the value you want to remove.

## Discussion

Discussion This method removes the specified key and value from the in-memory version of the store’s data. The next time the system synchronizes the data, it removes the key from the on-disk storage and iCloud server. If the key is not in the key-value store, this method does nothing.
