It depends on the functionality, you either want to do something after the superclass has completed its work or earlier.
For example, if a superclass contains some user interface elements, and you extend it, and your class will contain several more user interface elements. To get the size that matches your object, you probably call a superclass to calculate the size of its elements, and then add the size of the added elements to that size.
Otherwise, it does not make sense - the superclass does not know about your elements, so it will overwrite your calculations. Again, this is implementation dependent.
There is a specific case where you need to call the super method as the last:
-(void)dealloc { ... [super dealloc]; }
stefanB
source share