CodeGeek123
CodeGeek123

Reputation: 4501

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

Upvotes: 8

Views: 7420

Answers (2)

Arash Zeinoddini
Arash Zeinoddini

Reputation: 819

The difference between Asynchronous and Synchronous is that Synchronous is the more efficient method of PC communication. However Asynchronous is the most common method of communication used for email applications, internet access and networking. Synchronous is usually used for transmission of large data bocks.

Upvotes: 0

Carl Veazey
Carl Veazey

Reputation: 18363

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!

Upvotes: 12

Related Questions