简体   繁体   中英

What's iOS programming model of loading data from internet?

My application needs to load some data from Internet when application starts up. Obviously it should load data in a thread, and show a progress bar/circle on UI, then after data loaded, hide the progress bar and update UI using the data.

Can anybody show me some code to archive that? Did apple provide such sample? It's my first time to use thread in iOS.

You do not need multithreading to handle network communication without blocking your interface. What you need is asynchronous networking. This will also make your life a lot easier.

Have a look at AFNetworking , which is a framework supporting seamless async communication.

Here and here , you can find tutorials about AFNetwoking integration in your project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM