• 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
Use multiple NSURLConnection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Use multiple NSURLConnection


  • Subject: Use multiple NSURLConnection
  • From: email@hidden
  • Date: Wed, 3 Aug 2005 15:30:53 +0200

I need to use more than one NSURLConnection, but How can I do it in the same code?
Every NSURLConnection responds to - (void)connection: (NSURLConnection *)connection didReceiveData:(NSData *)dat



- (void) startDownloadingURL
{
NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:authString] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0];


theConnection=[[NSURLConnection alloc] initWithRequest:theRequest delegate:self];

    if (theConnection) receivedData=[[NSMutableData data] retain];
    else NSLog(@"Problems downloading data");

}





- (void)connection:(NSURLConnection *)connection didFailWithError: (NSError *)error
{


    [connection release];
    [receivedData release];

NSLog(@"Connection failed! Error - %@ %@", [error localizedDescription], [[error userInfo] objectForKey:NSErrorFailingURLStringKey]);


}



- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{

}


- (void)connection:(NSURLConnection *)connection didReceiveData: (NSData *)data
{
[receivedData appendData:data];
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: Use multiple NSURLConnection
      • From: Andrei Tchijov <email@hidden>
  • Prev by Date: Re: Cocoa Books?
  • Next by Date: tabs in a text view
  • Previous by thread: Re: addSubView
  • Next by thread: Re: Use multiple NSURLConnection
  • Index(es):
    • Date
    • Thread