---
title: removeAllObjects()
framework: foundation
role: symbol
role_heading: Instance Method
path: foundation/nscache/removeallobjects()
---

# removeAllObjects()

Empties the cache.

## Declaration

```swift
func removeAllObjects()
```

## See Also

### Adding and Removing Cached Values

- [setObject(_:forKey:)](foundation/nscache/setobject(_:forkey:).md)
- [setObject(_:forKey:cost:)](foundation/nscache/setobject(_:forkey:cost:).md)
- [removeObject(forKey:)](foundation/nscache/removeobject(forkey:).md)
