I have a UITableViewController
subclass that's instantiated, depending on where it's used, in a NIB or via code. In both cases I want to do customization in the initializer method. Does that mean I need to implement both initWithNibName:bundle:
and initWithCoder:
, and would each method call its respective super initializer?
While I don't need this right now, what if I also want to be able to instantiate the view controller with initWithStyle:
? Would I then need 3 different init methods that replicate the same behavior?
It seems like this violates the whole designated initializer convention, as there would essentially be 3 separate initializers that don't end up calling a common init method. Or is there a way to create a common designated initializer while supporting the 3 different instantiate routes?