---
title: "objc_getMetaClass(_:)"
framework: Objective-C Runtime
role: symbol
role_heading: Function
platforms: [iOS 2.0+, iPadOS 2.0+, Mac Catalyst 13.1+, macOS 10.0+, tvOS 9.0+, visionOS 1.0+, watchOS 1.0+]
path: "objectivec/objc_getmetaclass(_:)"
---

# objc_getMetaClass(_:)

Returns the metaclass definition of a specified class.

## Declaration

```swift
func objc_getMetaClass(_ name: UnsafePointer<CChar>) -> Any!
```

## Parameters

- `name`: The name of the class to look up.

## Return Value

Return Value The Class object for the metaclass of the named class, or nil if the class is not registered with the Objective-C runtime.

## Discussion

Discussion If the definition for the named class is not registered, this function calls the class handler callback and then checks a second time to see if the class is registered. However, every class definition must have a valid metaclass definition, and so the metaclass definition is always returned, whether it’s valid or not.

## See Also

### Obtaining Class Definitions

- [objc_getClassList(_:_:)](objectivec/objc_getclasslist(_:_:).md)
- [objc_copyClassList(_:)](objectivec/objc_copyclasslist(_:).md)
- [objc_lookUpClass(_:)](objectivec/objc_lookupclass(_:).md)
- [objc_getClass(_:)](objectivec/objc_getclass(_:).md)
- [objc_getRequiredClass(_:)](objectivec/objc_getrequiredclass(_:).md)
