I am writing a simulation program, which will present the user with a list of available simulators to run. Each simulator is implemented as a class, and I want to know the correct way for the program to keep track of the available simulator classes. Ideally the solution should be robust in the case of dynamically-loaded classes.
My first thought is to have a SimulatorManager class which exists as a singleton instance that keeps an NSArray of simulator classes, and have each simulator class implement +load to call [[SimulatorManager sharedInstance] registerSimulator:self]. However, I am not sure if this is the right way to do it, nor if it is even possible to rely on an instance of one class during +load of another.
How should I go about keeping a list of simulator classes known to the application?
My first thought is to have a SimulatorManager class which exists as a singleton instance that keeps an NSArray of simulator classes, and have each simulator class implement +load to call [[SimulatorManager sharedInstance] registerSimulator:self]. However, I am not sure if this is the right way to do it, nor if it is even possible to rely on an instance of one class during +load of another.
How should I go about keeping a list of simulator classes known to the application?