I have an application that I am working on that has several viewControllers, with each one displaying a single test for the user to do. At the moment, the user is able to go through each one individually. However, I am trying to implement a wizard-like function where a user can select multiple tests, or all tests, and the application in turn will iterate through each test, presenting each screen to the user, and once the user has submitted input, the application will move to the next test sequentially. Once all the tests have completed, the user will be brought back to the main screen. From what I have read, NSNotifications would be the best way to do this, but I honestly am new to this and need help. I realize that I should have in the method that initiates the wizard the line:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(testChange:)
name:@"Test"
object:nil];
I also know that once each viewController has finished running, it is to post a notification in the following way:
[[NSNotificationCenter defaultCenter] postNotificationName:@"Test" object:self];
My question is, if I have ten or twenty viewControllers selected by the user from a table, and these selections are stored in an array, do I need to have as many calls to the addObserver method, and as many postNotifications? What I would like to do is simply go through each viewController (as selected by the user), and once the user has finished submitted input to that viewController, that viewController should send a message, and the user should move on to the next viewController, and after finishing all tests, return to the main screen. Just as an FYI, I need to call each ViewController's (viewDidLoad) method.
I apologize if my question is confusing.