Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Synchronous Vs Asynchronous on iPhone

I was wondering what is should do in my case. I have to get data from a rest server and display it on my application. The UI for this is a webview and if no data is received from the server then there is nothing to display on the screen. In this case do i use an async request or a sync request? Also my other question is what is the difference between an async request as opposed to sync request on a seperate thread? (I thought thats what async does anyway).. ANy help would be greatly appreciated. Im a newbie to ios.. Thanks

like image 951
CodeGeek123 Avatar asked Aug 28 '12 10:08

CodeGeek123


1 Answers

You should always use asynchronous loading of network requests. Never block the main thread waiting for a network response.

Asynchronous can be either synchronous on a separate thread, or scheduled in the run loop of any thread.

Hope this helps!

like image 170
Carl Veazey Avatar answered Sep 20 '22 12:09

Carl Veazey