Here's my setup. I subclassed UIViewController
once to create a single "Widget" view controller that handles everything that all of my widgets can do. I then subclassed the Widget View Controller for each of my widgets, since they each handle their own unique and often complex set of functions.
I want to create an array of Widgets that stores each active widget in my scene, however I'm having trouble trying to figure out how to initialize the proper widget to store in the array. Initially I figured I could just do [widgets addObject:[[Widget alloc] initWithNibName:widgetName bundle:nil]];
, however that completely ignores the individual widget initWithNibName function and goes right to the abstracted Widget class (which makes sense, since that's the class that I'm loading it into...).
How can I get my classes loaded into this array properly with each widget being initialized by its own unique subclass? Feel free to recommend structural changes as well, if necessary.