0

I have an app where I need to get the list of countries,languages etc from web service and this is needed throughout the app. So, I have to call around 6 web services (SOAP). Where do I call these web services? Should it run in the background? If so the arrays will not be filled if the parsing has not finished yet and the user chooses to select a country, for example. Should I run it in appDelegate and wait till I get the list, then it might take time. This question may be dumb or repeated anywhere. I really need to know what's the best way. Any help would save me! Thanks a lot!

2 Answers2

0

In didFinishLaunchingWithOptions you could start a new thread to download these files, then when downloading finishes, you save them in order to be used later, note that you will have to start a new thread and not use the currrent one

Omar Abdelhafith
  • 21,163
  • 5
  • 52
  • 56
0

you can download the data in a background thread and show and activity indicator while the data is being downloaded. If you download the data in main thread, it will cause the UI to hang and the app will become unresponsive until the data is finished downloading. you can get a better idea of it from the following link.

download data in a thread

Community
  • 1
  • 1
ArunGJ
  • 2,685
  • 21
  • 27