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

# protocol_addMethodDescription(_:_:_:_:_:)

Adds a method to a protocol.

```
func protocol_addMethodDescription(_ proto: Protocol, _ name: Selector, _ types: UnsafePointer<CChar>?, _ isRequiredMethod: Bool, _ isInstanceMethod: Bool)
```

## Parameters

`proto`

The protocol you want to add a method to.

`name`

The name of the method you want to add.

`types`

A C string representing the signature of the method you want to add.

`isRequiredMethod`

A Boolean indicating whether the method is a required method of the `proto` protocol. If [`YES`](/documentation/ObjectiveC/YES), the method is a required method; if [`NO`](/documentation/ObjectiveC/NO), the method is an optional method.

`isInstanceMethod`

A Boolean indicating whether the method is an instance method. If [`YES`](/documentation/ObjectiveC/YES), the method is an instance method; if [`NO`](/documentation/ObjectiveC/NO), the method is a class method.

## Discussion

To add a method to a protocol using this function, the protocol must be under construction. That is, you must add any methods to `proto` before you register it with the Objective-C runtime (via the [`objc_registerProtocol(_:)`](/documentation/ObjectiveC/objc_registerProtocol(_:)) function).

---

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)