Adds a method to a protocol.
- iOS 4.3+
- macOS 10.7+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
- Objective-C Runtime
The protocol you want to add a method to.
The name of the method you want to add.
A C string representing the signature of the method you want to add.
A Boolean indicating whether the method is a required method of the
YES, the method is a required method; if
NO, the method is an optional method.
A Boolean indicating whether the method is an instance method. If
YES, the method is an instance method; if
NO, the method is a class method.
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