ios - NSURLConnection (initWithRequest vs sendAsyncRequest) -
if both initwithrequest , sendasyncrequest asynchronous ways of connections whats major difference ?
other completion handler , queue concept in sendasyncreq else ? 1 more advantageous ??
the sendasynchronousrequest
simpler , easier use, saving implementing nsurlconnectiondatadelegate
, nsurlconnectiondelegate
methods. if need richness of delegate approach (e.g. challenge-based authentication, need cancelable requests, etc.), sendasynchronousrequest
not job.
if targeting ios 7 , later, consider nsurlsession
, instead, too. can enjoy simplicity of block-based networking , still enjoy delegate methods if , when needed. requests cancelable. opens new opportunities (e.g. background sessions continue operating if app no longer active).
Comments
Post a Comment