Use multiple NSURLConnection
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