<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ObjectiveC",
  "identifier" : "/documentation/ObjectiveC/class_getClassMethod(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Objective-C Runtime"
    ],
    "preciseIdentifier" : "c:@F@class_getClassMethod"
  },
  "title" : "class_getClassMethod(_:_:)"
}
-->

# class_getClassMethod(_:_:)

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

```
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 [`SEL`](/documentation/ObjectiveC/SEL). Pass the selector of the method you want to retrieve.

## Return Value

A pointer to the [`Method`](/documentation/ObjectiveC/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

Note that this function searches superclasses for implementations, whereas [`class_copyMethodList(_:_:)`](/documentation/ObjectiveC/class_copyMethodList(_:_:)) does not.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)