---
title: NSExtraRefCount
framework: foundation
role: symbol
role_heading: Function
path: foundation/nsextrarefcount
---

# NSExtraRefCount

Returns the specified object’s reference count.

## Declaration

```occ
extern NSUInteger NSExtraRefCount(id object);
```

## Parameters

- `object`: An object.

## Return Value

Return Value The current reference count of object.

## Discussion

Discussion This function is used in conjunction with NSIncrementExtraRefCount and NSDecrementExtraRefCountWasZero in situations where you need to override an object’s retain and release methods. Special Considerations This function is deprecated and unavailable for use with ARC.

## See Also

### Object Allocation and Deallocation

- [NSAllocateObject](foundation/nsallocateobject.md)
- [NSCopyObject](foundation/nscopyobject.md)
- [NSDeallocateObject](foundation/nsdeallocateobject.md)
- [NSDecrementExtraRefCountWasZero](foundation/nsdecrementextrarefcountwaszero.md)
- [NSIncrementExtraRefCount](foundation/nsincrementextrarefcount.md)
- [NSShouldRetainWithZone](foundation/nsshouldretainwithzone.md)
