当我尝试识别NSURLConnection
. 根本imgConnection
不承认,xmlConnection
而是。
- (void) connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
if (connection == xmlConnection) {
[dataFinale appendData:data];
NSLog(@"XML");
}
else if (connection == imgConnection){
[imgData appendData:data];
NSLog(@"IMG");
}
}
NSURLRequest *requestImg = [NSURLRequest requestWithURL:urlImg cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:60];
imgConnection = [NSURLConnection connectionWithRequest:requestImg delegate:self];