• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSURLConnection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSURLConnection


  • Subject: Re: NSURLConnection
  • From: Fritz Anderson <email@hidden>
  • Date: Sun, 26 Jun 2011 11:52:11 -0500

On 26 Jun 2011, at 11:37 AM, R wrote:

> Any opinions on which approach is better.....
>
> NSData *data = [NSURLConnection sendSynchronousRequest:request
> 				returningResponse:&response
> 				error:&error];
>
> OR
>
> connectionInProgress=[[NSURLConnection alloc]initWithRequest:request
> 						delegate:self
> 					startImmediately:YES];
> }
...

Synchronous network operations are almost always a bad idea. You can't cancel them, you can't process the returned data on-the-fly, there's no way to provide credentials dynamically, and if you run them on your main thread, you lock up your human interface.

	— F

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSURLConnection
      • From: Jerry Krinock <email@hidden>
References: 
 >NSURLConnection (From: R <email@hidden>)

  • Prev by Date: NSURLConnection
  • Next by Date: Re: NSURLConnection
  • Previous by thread: NSURLConnection
  • Next by thread: Re: NSURLConnection
  • Index(es):
    • Date
    • Thread