iOS基础学习

Objective-C基础学习之Super关键字

2017-09-16  本文已影响0人  WenJim

1.super基本概念

self refers to the object receiving a message in objective-C programming.
super is a flag that tells the compiler to search for the method implementation in a very different place. It begins in the superclass of the class that defines the method where super appears.

2.super的作用

+ 1.直接调用父类中的某个方法
+ 2.super在对象方法中,那么就会调用父类的对象方法
 super在类方法中,那么就会调用父类的类方法
上一篇 下一篇

猜你喜欢

热点阅读