What is the proper, most efficient way to perform a query in a second thread and update the GUI in a delphi xe5 iOS application ? Currently, I've been starting the spinner (TaniIndicator) animation from the main thread, then creating the second thread, which in turns perform the database query AND updates the GUI. Before applying the work in the second thread, the app worked fine (minus the usage of a smooth spinner), but Ive noticed now that I have the workload placed in a second thread, the app sometimes crashes. I've also noticed the more extensive the GUI update, the more often it crashes as well....
What is the best way (safest and most efficient) to perform a database query and update the GUI using threads? example; Should I be setting the parent of created controls in the second thread to, 'nil' ?