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 3945654
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:02:29+00:00 2026-05-20T01:02:29+00:00

when I build and analize my application , am getting potential leak near the

  • 0

when I build and analize my application , am getting potential leak near the code [array1 release]…why its happening there..?thanks in advance

- (void) touchOnFeaturedCatalog
{
    searchId == 2;
    //featuredCatalogName = @"23064_Leeds2010";

    //NSString *response = [ZoomCatalogAppDelegate getResponseFromServer:[NSString stringWithFormat:@"http://www.zoomcatalog.com/iphone/iphone.php?catalog=%@&iphone=Yes&pdf=No", featuredCatalogName]]; 

    NSString *response = [ZoomCatalogAppDelegate getResponseFromServer:@"http://www.zoomcatalog.com/iphone/supplier.php"];
    //NSString *response = [ZoomCatalogAppDelegate getResponseFromServer:@"http://test.atvescape.com/articles.php"];
    //NSLog(@"Response = %@", response);
    NSArray *array = [response componentsSeparatedByString:@"##"];
    [array retain];

    for(int i = 0; i < array.count; i++)
    {
        NSLog(@"Trying outer loop.... %d, %@, %@", i, [array objectAtIndex:i], featuredCatalogName);
        NSArray *array4 = [featuredCatalogName componentsSeparatedByString:[array objectAtIndex:i]];
        if(array4.count > 1)
        {
            response = [ZoomCatalogAppDelegate getResponseFromServer:[NSString stringWithFormat:@"http://www.zoomcatalog.com/iphone/catalog_search.php?tid2=%@&iphone=yes", [array objectAtIndex:i]]]; 
            NSArray *array3= [response componentsSeparatedByString:@"<br>"];
            //baseURL = [NSString stringWithFormat:@"%@", [array3 objectAtIndex:0]];




            global_ContentString = [NSString stringWithFormat:@"%@", [array3 objectAtIndex:2]];//(searchId == 1 ? [array objectAtIndex:2] : ([array objectAtIndex: isLineNameSearch ? 2 :  1]))];
            [global_ContentString retain];  

        //  NSLog(@"baseURL = %@", global_ContentString);
            NSArray *array1 = [global_ContentString componentsSeparatedByString:@"@@#"];

            for(int j = 0; j < array1.count; j++)
            {
                NSArray *array2 = [[array1 objectAtIndex:j] componentsSeparatedByString:@"##"];         
                NSString *str = [NSString stringWithFormat:@"%@", [array2 objectAtIndex:0]];
                str = [str stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
                if ([str caseInsensitiveCompare:featuredCatalogName] == NSOrderedSame)
                {

                    global_ContentString = [ZoomCatalogAppDelegate getResponseFromServer:[NSString stringWithFormat:@"http://www.zoomcatalog.com/iphone/iphone.php?catalog=%@&iphone=Yes&pdf=No", [array2 objectAtIndex:5]]]; 
                    baseURL = [NSString stringWithFormat:@"%@", [[global_ContentString componentsSeparatedByString:@"<br>"] objectAtIndex:0]];
                    //global_ContentString = [NSString stringWithFormat:@"%@", [[global_ContentString componentsSeparatedByString:@"<br>"] objectAtIndex:1]];
                    [global_ContentString retain];

                    [global_MainPageController presentModalViewController:global_FullPageController animated:YES];
                    //NSLog(@"$$$$$$$$$$$$$$$$$$$$$$ Catalog id = %@ $$$$$$$$$$$$$$$$$$$$$$$$$$", [array2 objectAtIndex:5]);
                    //[array1 release];memory leak
                    return;
                }
            //  NSLog(@"Trying inner loop.... %d, %@, %@", j, str, featuredCatalogName);

            }


        }

    //  if([[array objectAtIndex:i] com 
    }
    [array release];
    return;
}

sorry for all..

  • 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-20T01:02:29+00:00Added an answer on May 20, 2026 at 1:02 am

    If you are only using an object locally (within the method in which it is created) you can autorelease it. Objects that are created or returned by convenience methods available until the end of the function call. Unless you need the objects elsewhere, I suggest ditching the retain calls. The rule of thumb is that whenever you call alloc, new, retain, or copy you mist release the object. However, if you use a convenience method, The returned object is autogenerate for you.

    It seems that you call [global_ContentString retain]; but then fail to call a corresponding release.

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

Sidebar

Related Questions

The result of Build and Analyze Showing me this line. Potential leak of an
When i do Build and analyze xCode gives me the following warning: Potential leak
Using the build and analyze of XCode I saw i have a memory leak
I need to build a windows server side application that will be responsible for
I'm building VS2010 solutions on a TFS2008 build agent with VS2010 Ultimate installed; code
I've ran Build and Analyze on my XML parsing code and found out the
When I build and analyze my project on XCode, I obtain a 'warning' on
I just upgraded to Xcode 3.2 and am using the Build and Analyze feature
I'd like to build a small Python program that can listen to and analyze
We build complicated console-based tools that produce a lot of commentary on the console.

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.