IOS--DAY06----iskindofclass ismemberofclass Dynamic identification (dynamics types)

Source: Internet
Author: User

-(BOOL) Iskindofclass:classobj to determine if this class or subclass of this class is an instance of

-(BOOL) ismemberofclass:classobj to determine if it is an instance of this class

--------------------------

-(BOOL) Respondstoselector:selector

+ (BOOL) instancesrespondtoselector:selector

Instancesrespondtoselector can only be written after the class name, and Respondstoselector may be written after the class name and the instance name.

[Class Instancesrespondtoselector] Determines whether an instance of the class contains a method, equivalent to: [Instance of the class Respondstoselector].

[Class Respondstoselector] is used to determine whether a class method is included.

-----------

-(ID) Performselector:selector calls the selector specified by this object

And the difference between direct calls:

Performselector is the runtime system is responsible for looking for methods, at compile time do not do any validation, if the direct call to compile is automatically verified.

When calling the method directly, be sure to declare the use of the method in the header file, and import the header file into it. While using Performselector, you can use the import header file to include the object of the method, directly

Performselector call.

IOS--DAY06----iskindofclass ismemberofclass Dynamic identification (dynamics types)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.