当我尝试识别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];
。
{{1}}