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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T10:30:04+00:00 2026-05-12T10:30:04+00:00

I’m still working on my leaks problem and I don’t know how to solve

  • 0

I’m still working on my leaks problem and I don’t know how to solve this one I have leaks on each arrayTmp addObject lines

NSMutableArray *arrayTmp= [[NSMutableArray alloc] init];


[arrayTmp addObject:[NSDictionary dictionaryWithObjectsAndKeys:@"1", @"value", @"Value 1", @"name", nil]];
[arrayTmp addObject:[NSDictionary dictionaryWithObjectsAndKeys:@"2", @"value", @"Value 2", @"name", nil]];
[arrayTmp addObject:[NSDictionary dictionaryWithObjectsAndKeys:@"3", @"value", @"Value 3", @"name", nil]];
[arrayTmp addObject:[NSDictionary dictionaryWithObjectsAndKeys:@"4", @"value", @"Value 4", @"name", nil]];
//add arrayTmp to an object to use later
[arrayTmp release];
arrayTmp=nil;

arrayTmp= [[NSMutableArray alloc] init];

[arrayTmp addObject:[NSDictionary dictionaryWithObjectsAndKeys:@"1", @"value", @"other value 1", @"name", nil]];
[arrayTmp addObject:[NSDictionary dictionaryWithObjectsAndKeys:@"2", @"value", @"other value 2", @"name", nil]];
//add arrayTmp to an object to use later
[arrayTmp release];
arrayTmp=nil;
...

Here the code of my Filter class

@implementation Filter

@synthesize label;
@synthesize valueIndex;
@synthesize listValue;
@synthesize webServiceFieldName;

-(id) initWithLabel:(NSString *)plabel AndValue:(int)pvalueIndex AndListValue:(NSMutableArray *)plistValue AndWebServiceFieldName:(NSString *)pwebServiceFieldName {

self = [super init];

if (self != nil) {
    self.label = plabel;
    self.valueIndex = pvalueIndex;
    self.listValue = plistValue;
    self.webServiceFieldName = pwebServiceFieldName;

}
return self;
}

@end
  • 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-12T10:30:05+00:00Added an answer on May 12, 2026 at 10:30 am

    Ok I made these changes but I still have dozen of leaks on these lines
    Here is a sample of my code

    -(id)initSearchFilters{
        self = [super init];
    
    
        if ( self ) {
    
        //init the search filters array
        self.searchFilters = [[NSMutableArray alloc] init];
        SearchCriteria *searchCriteriaTmp;
        Filter *filterTmp1;
        Filter *filterTmp2;
        NSMutableArray *arrayTmp= [[NSMutableArray alloc] init];
    
        //Price Range
        arrayTmp = [[NSMutableArray alloc] init];
    
        [arrayTmp addObject:[NSDictionary dictionaryWithObjectsAndKeys:@"any", @"value", @"any", @"name", nil]];
        [arrayTmp addObject:[NSDictionary dictionaryWithObjectsAndKeys:@"100", @"value", @"$100", @"name", nil]];
        [arrayTmp addObject:[NSDictionary dictionaryWithObjectsAndKeys:@"200", @"value", @"$200", @"name", nil]];
        [arrayTmp addObject:[NSDictionary dictionaryWithObjectsAndKeys:@"300", @"value", @"$300", @"name", nil]];
        [arrayTmp addObject:[NSDictionary dictionaryWithObjectsAndKeys:@"400", @"value", @"$400", @"name", nil]];
        [arrayTmp addObject:[NSDictionary dictionaryWithObjectsAndKeys:@"500", @"value", @"$500", @"name", nil]];
    
    
        filterTmp1 = [[Filter alloc] initWithLabel:@"Minimum Price" AndValue:0 AndListValue:arrayTmp AndWebServiceFieldName:@"price_min"];
        filterTmp2 = [[Filter alloc] initWithLabel:@"Maximum Price" AndValue:0 AndListValue:arrayTmp AndWebServiceFieldName:@"price_max"];
        searchCriteriaTmp = [[SearchCriteria alloc] initWithFilter1:filterTmp1 AndFilter2:filterTmp2 AndLabelSearchCriteria:@"Price Range" AndEnabled:NO];
        [self.searchFilters addObject:searchCriteriaTmp];
        [arrayTmp release];
        arrayTmp=nil;
        [filterTmp1 release];
        filterTmp1=nil;
        [filterTmp2 release];
        filterTmp2=nil;
        [searchCriteriaTmp release];
        searchCriteriaTmp=nil;
    
        //Item
        arrayTmp = [[NSMutableArray alloc] init];
    
        [arrayTmp addObject:[NSDictionary dictionaryWithObjectsAndKeys:@"1", @"value", @"item 1", @"name", nil]];
        [arrayTmp addObject:[NSDictionary dictionaryWithObjectsAndKeys:@"2", @"value", @"item 2", @"name", nil]];
        [arrayTmp addObject:[NSDictionary dictionaryWithObjectsAndKeys:@"3", @"value", @"item 3", @"name", nil]];
        [arrayTmp addObject:[NSDictionary dictionaryWithObjectsAndKeys:@"4", @"value", @"item 4", @"name", nil]];
    
        filterTmp1 = [[Filter alloc] initWithLabel:@"Item" AndValue:0 AndListValue:arrayTmp AndWebServiceFieldName:@"item"];
        searchCriteriaTmp = [[SearchCriteria alloc] initWithFilter1:filterTmp1 AndFilter2:nil AndLabelSearchCriteria:@"Item" AndEnabled:NO];
        [self.searchFilters addObject:searchCriteriaTmp];
        [arrayTmp release];
        arrayTmp=nil;
        [filterTmp1 release];
        filterTmp1=nil;
        [searchCriteriaTmp release];
        searchCriteriaTmp=nil;
        }
        return self;
    }
    

    And my search criteria class

    -(id)initWithFilter1:(Filter *)pFilter1 AndFilter2:(Filter *)pFilter2 AndLabelSearchCriteria:(NSString *)pLabelSearchCriteria AndEnabled:(BOOL)pEnabled{
    
    self = [super init];
    
    if (self != nil) {
        self.filter1 = pFilter1;
        self.filter2 = pFilter2;
        self.labelSearchCriteria = pLabelSearchCriteria;
        self.enabled =pEnabled;
    }
    return self;
    }
    
    - (void)dealloc
    {
    [filter1 release];
    [filter2 release];
    [labelSearchCriteria release];
    [super dealloc];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.