Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6635895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:06:52+00:00 2026-05-25T23:06:52+00:00

iam making one applciation.In that iam using the NSUrlconnection class.Below one is my code.

  • 0

iam making one applciation.In that iam using the NSUrlconnection class.Below one is my code.

- (void)viewDidLoad {
[super viewDidLoad];
responsedata = [[NSMutableData data] retain];
NSString *url = [NSString stringWithFormat:@"https://www.google.com"];
NSURL *URL = [NSURL URLWithString:url];
NSURLRequest *request=[[NSURLRequest alloc]initWithURL:URL];
[[NSURLConnection alloc] initWithRequest:request delegate:self];

[request release];
}

-(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response 
{

   [responsedata setLength:0];
}
 - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
[responsedata appendData:data];
   }

  - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
    }
  - (void)connectionDidFinishLoading:(NSURLConnection *)connection {

     [connection release];
    }

In this code when iam executing,it shows the memory leak at
responsedata = [[NSMutableData data] retain];
[[NSURLConnection alloc] initWithRequest:request delegate:self]; in viewDidLoad()
.SO please tell me where it released.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T23:06:53+00:00Added an answer on May 25, 2026 at 11:06 pm
    1. You should save reference to your NSURLConnection :

      NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];

    2. You should start it:

      [connection start];

    3. And you should release it in didFailWithError or connectionDidFinishLoading.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am making applications in c#.In that application i have one class as DataCapture.cs
I am making an application that connects to our billing software using its API,
I am making a simple iphone application where I have certain textfields one below
I am making an application in c#. In that application I have one byte
I am making application using c#. I have one queue as follows... Queue QueueData
I am making one application where i am reading mails from Lotus Notes. I
I am making a C++ program. One of my biggest annoyances with C++ is
I am making an ajax request from a jquery script to one of my
I am making an installer in java swing it almost completed only one thing
I am currently building an making my new website. It uses one page and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.