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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:27:09+00:00 2026-05-26T10:27:09+00:00

Update Solved the issue and there was an cycle retain. Original Question Profile showed

  • 0

Update

Solved the issue and there was an cycle retain.

Original Question

Profile showed zero memory leak, however the app used more and more memory as time went.

Let’s just take one of the things in the app, and have a detailed look. There is a table view – let’s call it the main table, when click on any of its cell, it leads you to a second table view and the second one has 10 to 20 images on it.

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    FlyerListTable *detail = [[FlyerListTable alloc] initWithNibName:@"FlyerListTable" bundle:nil]; 
    detail.department = [categories objectAtIndex: indexPath.row];
    detail.promotions = [items valueForKey:detail.department];
    [self.navigationController pushViewController:detail animated:NO];
    [detail release];
}

FlyerListTable is the class for the second table, and it has dealloc defined, however I traced it and this dealloc method was never called.

  • 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-26T10:27:09+00:00Added an answer on May 26, 2026 at 10:27 am

    What’s the convention or best practice?

    I would suggest you to make it lazy loaded:

    - (FlyerListTable*)flyerListTable
    {
        if (_flyerListTable == nil)
            _flyerListTable = [[FlyerListTable alloc] initWithNibName:@"FlyerListTable" bundle:nil];
        return _flyerListTable;
    }
    

    Do not forget to release it in dealloc.

    Then use it when the row is selected

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
        FlyerListTable* detail = [self flyerListTable];
        detail.department = [categories objectAtIndex: indexPath.row];
        detail.promotions = [items valueForKey:detail.department];
        [self.navigationController pushViewController:detail animated:NO];
    }
    

    When I traced it, this dealloc method was never called.

    If dealloc is not called in your example it means some other object has retained it. Try to find out what object may retain it before you make any changes. You can override retain method for this purpose:

    - (id)retain
    {
        return [super retain];
    }
    

    Set a break point to see the call stack. You should not use ARC of course.

    Good luck!

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

Sidebar

Related Questions

UPDATE The issue is solved, all the code you can see works. Hello! I
Update: Solved, with code I got it working, see my answer below for the
UPDATE: Solved. Thanks BusyMark! EDIT: This is revised based on the answer below from
UPDATE: SOLVED Hi all, i've got it, just save cookie to temp file, and
UPDATE: First problem solved, second one described at the bottom of this post. UPDATE2:
Update II Problem Solved but Why? This has been the biggest headache ever. My
Update: Check out this follow-up question: Gem Update on Windows - is it broken?
In the app I'm writing, NSDate *test = [NSDate distantPast]; [test retain]; // crashes
UPDATE: I've filed this as an issue on Microsoft Connect if you can reproduce
I know there were a couple similar questions, but none solved my problem. This

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.