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

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

datatable - Matlab struct computations -