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

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

Adds a method to a protocol.

## Declaration

```swift
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 doc://com.apple.objectivec/documentation/ObjectiveC/YES, the method is a required method; if doc://com.apple.objectivec/documentation/ObjectiveC/NO, the method is an optional method.
- `isInstanceMethod`: A Boolean indicating whether the method is an instance method. If doc://com.apple.objectivec/documentation/ObjectiveC/YES, the method is an instance method; if doc://com.apple.objectivec/documentation/ObjectiveC/NO, the method is a class method.

## Discussion

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(_:) function).

## See Also

### Working with Protocols

- [objc_getProtocol(_:)](objectivec/objc_getprotocol(_:).md)
- [objc_copyProtocolList(_:)](objectivec/objc_copyprotocollist(_:).md)
- [objc_allocateProtocol(_:)](objectivec/objc_allocateprotocol(_:).md)
- [objc_registerProtocol(_:)](objectivec/objc_registerprotocol(_:).md)
- [protocol_addProtocol(_:_:)](objectivec/protocol_addprotocol(_:_:).md)
- [protocol_addProperty(_:_:_:_:_:_:)](objectivec/protocol_addproperty(_:_:_:_:_:_:).md)
- [protocol_getName(_:)](objectivec/protocol_getname(_:).md)
- [protocol_isEqual(_:_:)](objectivec/protocol_isequal(_:_:).md)
- [protocol_copyMethodDescriptionList(_:_:_:_:)](objectivec/protocol_copymethoddescriptionlist(_:_:_:_:).md)
- [protocol_getMethodDescription(_:_:_:_:)](objectivec/protocol_getmethoddescription(_:_:_:_:).md)
- [protocol_copyPropertyList(_:_:)](objectivec/protocol_copypropertylist(_:_:).md)
- [protocol_getProperty(_:_:_:_:)](objectivec/protocol_getproperty(_:_:_:_:).md)
- [protocol_copyProtocolList(_:_:)](objectivec/protocol_copyprotocollist(_:_:).md)
- [protocol_conformsToProtocol(_:_:)](objectivec/protocol_conformstoprotocol(_:_:).md)
