Returns an array of the properties declared by a protocol.
SDKs
- iOS 2.0+
- macOS 10.5+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Objective-C Runtime
Declaration
objc _property _t _Nonnull * protocol_copyPropertyList(Protocol *proto, unsigned int *outCount);
Parameters
proto
A protocol.
outCount
Upon return, contains the number of elements in the returned array.
Return Value
A C array of pointers of type objc
describing the properties declared by proto
. Any properties declared by other protocols adopted by this protocol are not included. The array contains *out
pointers followed by a NULL
terminator. You must free the array with free()
.
If the protocol declares no properties, NULL
is returned and *out
is 0
.