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

  • Home
  • SEARCH
  • 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 6961877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:35:16+00:00 2026-05-27T15:35:16+00:00

i have 3 classes in this application. Memory leak is happened in DetailBrand2.m ,

  • 0

i have 3 classes in this application.

Memory leak is happened in DetailBrand2.m ,
DetailBrand2 inherited from DetailType,
Also i have a wrapper class , FairPriceDatabaseView, which communicate with sqlite3.

I have confused with NSDictionary, NSString and Sqlite?

The leak is happened in this line!!!?

NSDictionary * brandRow = [fairPrice_DB getProductRow:tempProductID];

NSString *message = [brandRow objectForKey:@”brandName”];

brandRow = nil;

I have just started within iphone appmication, i appreciate in advance for any help, i have read many iphone memory management guide but i can not solve it. The issue is that i have not used any of keywords look like alloc, retain, copy or mutablecopy but i have leak in this line!!

This line bring back an NSDictionary which contains productID,productName,brandName,price. from wrapper class, fairPrice_DB is an instanse of FairPriceDatabaseView.

DetailBrand2.h

@interface DetailBrand2 : DetailType
{
    NSString * topBrandName;
    NSNumber * tempProductID;
    NSString * brandName;
}
@property (nonatomic, retain) NSString * topBrandName;
@property (nonatomic, retain) NSString * brandName;
@property (nonatomic, retain) NSNumber * tempProductID;

-(void) loadbrandName;

@end

DetailBrand2.m

#import "DetailBrand2.h"
#import "SeventhFairPriceAppDelegate.h"

@implementation DetailBrand2

@synthesize topBrandName,brandName,tempProductID;

-(void) loadbrandName
{
    if(!topBrandName)
    {
        [self loadDB];
        *NSDictionary * brandRow = [fairPrice_DB getProductRow:tempProductID];*
        NSString *message = [brandRow objectForKey:@"brandName"];
        brandRow = nil;
        self.topBrandName = message;
//        self.brandName =  self.topBrandName;
    }
}
  • 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-27T15:35:16+00:00Added an answer on May 27, 2026 at 3:35 pm

    The Problem is solved by overwriting dealloc method 😀

    DetailBrands.m

     -(void) dealloc
        {
              [self.tempProductID release];
              [self.topBrandName release];
              [self.brandName release];
              [super dealloc];
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this application with 2 classes, in the first class I define a
I have an application that experiences a slow memory leak from the word go.
I have classes structured like this: Public MustInherit Class A ' several properties End
I have 2 classes with this structure: class ClassA { String typeA; List<String> valuesA;
Supposed I have two classes like this: public class Parent { public string Id
Let's say I have some classes like this: abstract class View(val writer: XMLStreamWriter) {
I currently have service classes that look something like this public class UserService :
my code is like this: i have two classes first class: public class Box<E>
Say I have two classes like this: class A{ private static Random random =
If I have this classes: public interface IBinaryCalculator{ double addition(double numb1, double numb2); }

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.