Suppose I want to reset an object to its initial state. It seems like the natural thing to do would be to run it through its init method — but Apple guidelines are that I only want to do this once.
Creating a new object is not a satisfactory solution, because I need to preserve pointers to the object from elsewhere.
The object is part of a large class hierarchy. I will probably want to be able to reset most anything in the hierarchy.
Suggestions?
Create a
resetmethod. This method could then in turn be called byinitand if it is in a hiearchy all classes should implement it and callsuper reset.