Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is synchronous and asynchronous in iphone and iPad?

Tags:

iphone

ipad

What is synchronous and asynchronous in ios ? I am new in objective c. Which one i should use in my code while i am getting data from server. So please help me.

Thanks in advance.

like image 782
Sarabjit Singh Avatar asked Sep 09 '13 10:09

Sarabjit Singh


1 Answers

You should always use asynchronous loading of network requests.

Asynchronous 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.

Synchronous blocks main thread until they complete request.

For Demo code or turorial have a look into this link Asynchronous web service client using NSURLConnection and SBJSON

like image 53
abhishekkharwar Avatar answered Nov 09 '22 23:11

abhishekkharwar