I have an init method that is used and overridden through out an extensive heirarchy. Each init call however extends on the work that the previous did. So naturally, I would
Make the class at the top of the inheritance tree set a flag on initialization. Then a class in the bottom of the inheritance tree can check for that flag to see if the whole tree has been traversed. I would make documentation that every child of base
should include the following init code:
super.init()
if (!_baseIsInitialized) {
// throw exception or do w/e you wish
}
where base uses
_baseIsInitialized = true;
The other way around, forcing your childs to call super.init()
is a lot thougher and would most likely include ugly hacks.