Refresh Picker Data.
Hi. I'm REALLY struggling w/ refreshing picker data. My pickers are populated from a SQLite DB.
The pickers get created and populated when the application loads. Via a load function. Here is a sample on load function: <script src='http://pastie.org/1243479.js'></script>
After the user connects to the database, I wish to refresh the pickers with potentially new data. Here is my reload function: <script src='http://pastie.org/1243480.js'></script>
This function is called after I update my local sqlite DB. If I shut down the application and start again, my new data is there. But, otherwise, it is not.
I have tried…
reloadColumn (crash)
reloading an empty array into the picker and then reload w/ data (crash)
I can just do an add - and it will add all the data AGAIN, so then I have duplicate entries.
Any help is MUCH appreciated.
Thanks.
Jennifer
1 Answer
-
The add method appends data to the picker, it does not replace it. There is a method in the iOS implementation that is called remove but it has no code so it is essentially useless right now. From what I can see in the picker there is nothing present that would allow you to replace data.
At this time I think you only thing you can do is replace the picker, not just reload it. I know it's not the answer you probably wanted.