Purpose of methods that only call super?

inheritance, objective-c, xcode

Solution

The default template code defines methods that are meant to be filled out with your customized code. The calls to super are there to remind you to make the call. The generated code is not meant to be a finished application. Think of the call to super as similar to the empty class definitions. You fill out the classes and therefore fill out the methods definitions

Problem

In Xcode, a lot of the auto-generated class files (especially those for UIViewController subclasses) will include methods that resemble the following: ``` - (void)dealloc { [super dealloc] } ``` To me, this seems fairly pointless - if all a method is going to do is call super, why have it at all? Is there a purpose to these methods being generated?

Original source