Check if subclass overrides a method

前端 未结 7 2267
耶瑟儿~
耶瑟儿~ 2021-02-09 13:15

Is it possible to check whether a subclass implements a method that exists either in its immediate superclass or in some superclass of its superclass, etc?

E.g. I subcla

7条回答
  •  一整个雨季
    2021-02-09 13:54

    Using the runtime, you want to use the function Method

    * class_copyMethodList ( Class cls, unsigned int *outCount );
    

    This will give you a list to work with.

提交回复
热议问题