Recently I realized I needed to add an argument to the init method for a helper class I've got. The helper class deals with alert views so it already has a bunch of arguments in the init, which are looked at, tweaked, and then sent on to the alert view.
Since I'm using the method as it is in various places, I don't want to risk crashing (by missing one of those places and getting an 'unrecognized selector' in the hands of a customer) so I decided to add a second init method.
I.e.
- (id)initWithA:B:C:D:
and
- (id)initWithA:B:C:foo:D:
Right now I've simply copy pasted the first one's implementation into the foo: one, but ideally what would be nice is making the first call the second, i.e.
- (id)initWithA:a B:b C:c D:d
{
return [self initWithA:a B:b C:c foo:nil D:d];
}
but I'm not sure if this is acceptable or not. Code appears to be working fine.