In several interviews I have been asked about handling of connection, web service calls, server responses and all. Even now I am not clear about many things.Could you please help me to get a better idea about the following scenarios?
What is the advantage of using
NSURLSessionDataTask
instead ofNSURLConnection
-I have an idea like data loss will not happen even if the connection breaks forNSURLSessionDataTask
but not for the latter.But how it works?If the connection breaks after sending the request to a server or while connecting to server , How can we handle the code at our end in case of
NSURLConnection
andNSURLSessionDataTask
?-My idea is to use Reachability classes and check when it becomes online.The data we are sending got updated at the server side. But we don't get the response from server. What can we do at our side to handle this situation?- Incrementing timeOutInterval is the only thing that we can do?
Please help me with these scenarios. Thank you very much in advance!!