iDev
iDev

Reputation: 2421

releasing NSURLConnection Object

I have used the following code :

 NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
    if (theConnection) 
    {
        responseData = [[NSMutableData data] retain];
    }

in viewDidLoad method. But, I get a memory leak error on :

responseData = [[NSMutableData data] retain];

How do I release theConnection?

Upvotes: 0

Views: 135

Answers (1)

mhmwadm
mhmwadm

Reputation: 26

receiveData is a class member,so I think release it in viewDidUnload is OK.

Upvotes: 1

Related Questions