This is basic question about iOS.
I will be happy if this question is helpful for other beginners.
In the classB(UIView object), classA(also UIView object) is added by addSubview method.
In this case, my questions are as below.
Questions.
What is ‘super class’ of class B? ‘Class A’ Or ‘UIView’ ??
2.What is ‘super view’ of class B? ‘Class A.view’ right?
in the state of [super viewDidload: ] in classB, super means what ? ‘Class A’ Or ‘UIView’ ?
Thanks
They are three different things that happen to use the same word "super".
1. The superclass of B is UIView (assuming you didn't actually declare B to be a subclass of A). This is a relationship between the classes.
2. If you did '[anA addSubview: someB]', the superview of the instance of B is an instance of A. This is a relationship between instances of the classes.
3. In '[super viewDidLoad]', 'super' means the same object as 'self', so the class of this 'super' is B. However, by using 'super', you're telling the compiler that you do not want to invoke class B's 'viewDidLoad' method, but its superclass's 'viewDidLoad'. That means UIView's viewDidLoad, not A's.