Original problem: I need to load 3 pickers, with the selection choices of each subsequent picker dependent upon the ones before it – and with each of the subsequent arrays generated dynamically based upon (a) the prior choices and (b) a database of some 500 objects.
- Picker one works fine because its array of options does not change and is only dependent upon the data file.
- Picker two works fine because it updates strictly in accordance with picker 1.
- Picker three, however, needs to know the choice in picker 2 in order to generate its options. But the options in picker 2 are generated dynamically from the choice in picker 1.
Therefore, if the choice in picker 1 changes such that the length of the array (of choices) in picker 2 is smaller than the specific choice being fed to picker 3, the program crashes with an out of range error. I completely understand why the crash is occurring (it's clear). But it seems like what I'm trying to achieve here would be fairly common and that there should be a solution. All the solutions I could find deal with instances where the picker arrays could be fixed in advance (e.g. the Country/City example that comes up repeatedly).