One, inherit the syntax form:
@interface Class Name: Parent class name
Second, the main points of inheritance grammar:
1, the inherited class is called the parent class or superclass, and the inherited class is called a subclass.
2, basically all classes inherit from NSObject (base class).
3, the subclass inherits all the member variables and methods in the parent class and the parent class of the parent class.
4, the name of the member variable in the parent class and subclass cannot be the same, otherwise it will be an error.
5, the parent class and the subclass of the method name can be the same, when the subclass has the same method or method in the parent class implementation, when the subclass calls this method, the system will first call the subclass of the same name method. This practice is called rewriting.
6, in the override of the Super keyword can be called directly in the parent class method, mainly used when the subclass extends the parent class method. The Super and Self keywords are similar in other usages.
Third, the advantages of inheriting the syntax:
1, avoids duplication of code.
2, the connection between classes and classes can be established.
Four, the disadvantage of inheritance syntax:
1, enhance the coupling of the program, when the parent class is changed or deleted, it will seriously affect the operation of the subclass.
I summarize myself, if there are mistakes, please correct me, thank you.
Objective-c one of three major features: inheritance