---
title: getObject
framework: kernel
role: pseudoSymbol
path: kernel/osdictionary/1808133-getobject
---

# getObject

Returns the object stored under a given key.

## Declaration

```occ
virtual OSObject * getObject(
 const char *aKey) const; 
```

## Parameters

- `aKey`: A C string key identifying the object to be returned to caller.

## Return Value

Return Value The object stored under aKey, or NULL if the key does not exist in the dictionary.

## Overview

Overview The returned object will be released if removed from the dictionary; if you plan to store the reference, you should call retain on that object.

## See Also

### Miscellaneous

- [copyCollection](kernel/osdictionary/1808081-copycollection.md)
- [ensureCapacity](kernel/osdictionary/1808087-ensurecapacity.md)
- [flushCollection](kernel/osdictionary/1808092-flushcollection.md)
- [free](kernel/osdictionary/1808101-free.md)
- [getCapacity](kernel/osdictionary/1808107-getcapacity.md)
- [getCapacityIncrement](kernel/osdictionary/1808116-getcapacityincrement.md)
- [getCount](kernel/osdictionary/1808124-getcount.md)
- [getObject(const OSString *)](kernel/osdictionary/1808139-getobject.md)
- [getObject(const OSSymbol *)](kernel/osdictionary/1808148-getobject.md)
- [initWithCapacity](kernel/osdictionary/1808159-initwithcapacity.md)
- [initWithDictionary](kernel/osdictionary/1808166-initwithdictionary.md)
- [initWithObjects(const OSObject *, const OSString *, unsigned int, unsigned int)](kernel/osdictionary/1808177-initwithobjects.md)
- [initWithObjects(const OSObject *, const OSSymbol *, unsigned int, unsigned int)](kernel/osdictionary/1808181-initwithobjects.md)
- [isEqualTo](kernel/osdictionary/1808187-isequalto.md)
- [isEqualTo(const OSDictionary *)](kernel/osdictionary/1808191-isequalto.md)
- [isEqualTo(const OSDictionary *, const OSCollection *)](kernel/osdictionary/1808194-isequalto.md)
- [merge](kernel/osdictionary/1808198-merge.md)
- [removeObject](kernel/osdictionary/1808205-removeobject.md)
- [removeObject(const OSString *)](kernel/osdictionary/1808207-removeobject.md)
- [removeObject(const OSSymbol *)](kernel/osdictionary/1808209-removeobject.md)
- [serialize](kernel/osdictionary/1808214-serialize.md)
- [setCapacityIncrement](kernel/osdictionary/1808218-setcapacityincrement.md)
- [setObject](kernel/osdictionary/1808220-setobject.md)
- [setObject(const OSString *, const OSMetaClassBase *)](kernel/osdictionary/1808224-setobject.md)
- [setObject(const OSSymbol *, const OSMetaClassBase *)](kernel/osdictionary/1808227-setobject.md)
- [withCapacity](kernel/osdictionary/1808230-withcapacity.md)
- [withDictionary](kernel/osdictionary/1808234-withdictionary.md)
- [withObjects(const OSObject *, const OSString *, unsigned int, unsigned int)](kernel/osdictionary/1808237-withobjects.md)
- [withObjects(const OSObject *, const OSSymbol *, unsigned int, unsigned int)](kernel/osdictionary/1808240-withobjects.md)
