Quand je lance l'instrument que je suis arrivé lien mémoire dans la ligne ci-dessousFuite de mémoire identifiée pour NSURLConnection
NSData *responseData = [NSURLConnection sendSynchronousRequest:theRequest
returningResponse:&urlResponse error:&error];
quelqu'un peut me expliquer comment résoudre ce problème,
Merci Sam.
- (NSString *)sendHttpsReq:(NSString *) urlString {
// create the request
NSString *endResult = nil;
NSURL *posHostUrl = [NSURL URLWithString:urlString];
NSURLRequest *theRequest=[NSURLRequest requestWithURL:posHostUrl
cachePolicy:NSURLCacheStorageAllowed
timeoutInterval:300.0];
// create the connection with the request
// and start loading the data
[NSURLRequest setAllowsAnyHTTPSCertificate:YES forHost:[posHostUrl host]];
NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
if (theConnection) {
// Create the NSMutableData that will hold
// the received data
// receivedData is declared as a method instance elsewhere
NSHTTPURLResponse* urlResponse = nil;
//NSError *error = [[NSError alloc] init];
NSError *error = nil;
NSData *responseData = [NSURLConnection sendSynchronousRequest:theRequest returningResponse:&urlResponse error:&error];
endResult = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
//[error release];
} else{
//Inform the user that the connection failed.
NSLog(@"CONNECTION FAILED");
}
[theConnection release];
return [endResult autorelease];
}
Merci pour votre aide. – Sam