• 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: "Gary L. Wade" <email@hidden>
  • Date: Sun, 26 Jun 2011 09:55:22 -0700

The asynchronous option allows you to report progress and utilize your data immediately and do with it whatever you wish while the synchronous option requires you wait until the entire data has been retrieved, possibly an issue if you have data of any size. Also, for UI responsiveness, the synchronous option really only makes sense on a secondary thread while the asynchronous option can be fully performed on the main thread.

- Gary L. Wade (Sent from my iPhone)

On Jun 26, 2011, at 9:37 AM, R <email@hidden> 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];
> }
>
>
> - (void)connection:(NSURLConnection *)connection didReceiveData:
> (NSData *)data{
> }
>
> - (void)connection:(NSURLConnection *)connection didFailWithError:
> (NSError *)error{
> }
>
> - (void)connectionDidFinishLoading:(NSURLConnection *)connection{
> }
_______________________________________________

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

References: 
 >NSURLConnection (From: R <email@hidden>)

  • Prev by Date: Re: NSURLConnection
  • Next by Date: Problem with setNeedsLayout and layoutSubviews in UIScrollView
  • Previous by thread: Re: NSURLConnection
  • Next by thread: Problem with setNeedsLayout and layoutSubviews in UIScrollView
  • Index(es):
    • Date
    • Thread