NSURLConnection shown as leaking in instruments
- by Gyozo Kudor
Hello another stupid question regarding leaks and also NSURLConnection. How do i release it? Is it enough if i release in the following 2 methods?
(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
(void)connectionDidFinishLoading:(NSURLConnection *)connection
Because in instruments it shows me the line where I alloc my connection as the source of leaking.
OK I don't get it. After the following code my urlConnection has a retain count of 2. WTF?
NSURLConnection *urlConnection = [[NSURLConnection alloc] initWithRequest: urlRequest delegate: self];
This is the line that instruments points me to. I find this very weird.