---
title: "class_getClassMethod(_:_:)"
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/class_getclassmethod(_:_:)"
---

# class_getClassMethod(_:_:)

Returns a pointer to the data structure describing a given class method for a given class.

## Declaration

```swift
func class_getClassMethod(_ cls: AnyClass?, _ name: Selector) -> Method?
```

## Parameters

- `cls`: A pointer to a class definition. Pass the class that contains the method you want to retrieve.
- `name`: A pointer of type doc://com.apple.objectivec/documentation/ObjectiveC/SEL. Pass the selector of the method you want to retrieve.

## Return Value

Return Value A pointer to the Method data structure that corresponds to the implementation of the selector specified by aSelector for the class specified by aClass, or NULL if the specified class or its superclasses do not contain a class method with the specified selector.

## Discussion

Discussion Note that this function searches superclasses for implementations, whereas class_copyMethodList(_:_:) does not.

## See Also

### Working with Classes

- [class_getName(_:)](objectivec/class_getname(_:).md)
- [class_getSuperclass(_:)](objectivec/class_getsuperclass(_:).md)
- [class_setSuperclass(_:_:)](objectivec/class_setsuperclass(_:_:).md)
- [class_isMetaClass(_:)](objectivec/class_ismetaclass(_:).md)
- [class_getInstanceSize(_:)](objectivec/class_getinstancesize(_:).md)
- [class_getInstanceVariable(_:_:)](objectivec/class_getinstancevariable(_:_:).md)
- [class_getClassVariable(_:_:)](objectivec/class_getclassvariable(_:_:).md)
- [class_addIvar(_:_:_:_:_:)](objectivec/class_addivar(_:_:_:_:_:).md)
- [class_copyIvarList(_:_:)](objectivec/class_copyivarlist(_:_:).md)
- [class_getIvarLayout(_:)](objectivec/class_getivarlayout(_:).md)
- [class_setIvarLayout(_:_:)](objectivec/class_setivarlayout(_:_:).md)
- [class_getWeakIvarLayout(_:)](objectivec/class_getweakivarlayout(_:).md)
- [class_setWeakIvarLayout(_:_:)](objectivec/class_setweakivarlayout(_:_:).md)
- [class_getProperty(_:_:)](objectivec/class_getproperty(_:_:).md)
- [class_copyPropertyList(_:_:)](objectivec/class_copypropertylist(_:_:).md)
