Instance Method インスタンスメソッド

conformsToProtocol:

Returns a Boolean value that indicates whether the receiver conforms to a given protocol. レシーバが指定したプロトコルに準拠するかどうかを指し示すブール値を返します。

Declaration 宣言

- (BOOL)conformsToProtocol:(Protocol *)aProtocol;

Parameters パラメータ

aProtocol

A protocol object that represents a particular protocol.

Return Value 戻り値

YES if the receiver conforms to aProtocol, otherwise NO.

Discussion 解説

This method works identically to the conformsToProtocol: class method declared in NSObject. It’s provided as a convenience so that you don’t need to get the class object to find out whether an instance can respond to a given set of messages.

See Also 参照

Testing Object Inheritance, Behavior, and Conformance