Instance Method is Member Of Class:
Returns a Boolean value that indicates whether the receiver is an instance of a given class.
iOS 2.0+ macOS 10.0+ Mac Catalyst 13.0+ Beta tvOS 9.0+ watchOS 2.0+ Declaration - ( ) BOOL isMemberOfClass:( ) Class aClass;
A class object representing the Objective-C class to be tested.
if the receiver is an instance of
For example, in this code,
is Member Of Class:
NSMutableData *myData = [NSMutableData dataWithCapacity:30];
id anArchiver = [[NSArchiver alloc] initForWritingWithMutableData:myData];
if ([anArchiver isMemberOfClass:[NSCoder class]])
Class objects may be compiler-created objects but they still support the concept of membership. Thus, you can use this method to verify that the receiver is a specific Class object.
See Also Testing Object Inheritance, Behavior, and Conformance - is Kind Of Class:
Returns a Boolean value that indicates whether the receiver is an instance of given class or an instance of any class that inherits from that class.
Required. - responds To Selector:
Returns a Boolean value that indicates whether the receiver implements or inherits a method that can respond to a specified message.
Required. - conforms To Protocol:
Returns a Boolean value that indicates whether the receiver conforms to a given protocol.
This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.
Learn more about using Apple's beta software