Objective-C - Overriding method in subclass

前端 未结 5 1434
借酒劲吻你
借酒劲吻你 2021-01-07 17:20

I am having some trouble figuring out hour to accurately override a method in one of my subclasses.

I have subclass (ClassB) of another customclass (ClassA):

5条回答
  •  没有蜡笔的小新
    2021-01-07 18:02

    You just add your custom code in methodName in classB :

    - (void)methodName
    {
        // custom code
    
        // call through to parent class implementation, if you want
        [super methodName];
    }
    

提交回复
热议问题