How do I know which initializer is the designated initializer for ANY class?
I’m guessing that it is the one that takes the most parameters, but there could be times where this is not correct.
How do I know which initializer is the designated initializer for ANY class? I’m
Share
omz’s answer can be stated more firmly: The documentation for a framework class will specify which is the designated initializer. It’s necessary to know what the designated initializer is in order to write subclasses that behave properly. The subclass’s D.I. must call up to the superclass’s D.I. in order to be sure that it is properly initialized.
Your guess about the greatest number of parameters is well-founded, however. Apple actually states that it is often the D.I. in a few places.
Cocoa Core Competencies
Cocoa Fundamentals