Hi, im searching for a convenient way of adding new arguments to multiple init-methods. its a little bit hard to discribe but my problem is the following:
I have a class witch implements various init-methods. f.e.
@interface Circle {
CGPoint center;
float radius;
}
- (id)initWithCenter:...radius:...;
- (id)initWithRect:...;
- (id)initWithPoly:...;
Now f.e. i want to create a crosshair-class as a subclass. So i want to add maybe some lines as instance variables. So the problem is, every crosshair-object has to be initialized with some specific values, but of course the methods to initialize the circle wouldnt change. so i want every init-method from the superclass but add those specific arguments to each.
the direct way (in my unexperienced eyes) is to overwrite each method in witch i then call the according super-method and afterwards do my stuff. But this is very annoying if youve got 10 or more init methods and just want to add the same arguments to each. So im asking if theres a better approach to accomplish this? either with the ability to modify the superclass or without.
thanks a lot