If I override a class method, is there a way I can call the original method (the one that was overridden)?

前端 未结 3 1881
清酒与你
清酒与你 2021-01-03 13:53

In Objective-C, if I override a class method using a category, is there a way I can call the original method (the one that was overridden)?

3条回答
  •  清歌不尽
    2021-01-03 14:51

    If you dynamically provide the category override (see resolveInstanceMethod:), you can cache the previous method selector beforehand, and call that.

提交回复
热议问题