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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:58:00+00:00 2026-05-11T20:58:00+00:00

So I’m making a very basic Twitter app (it’s actually Presence 2 from the

  • 0

So I’m making a very basic Twitter app (it’s actually Presence 2 from the Stanford iPhone course that’s on iTunes), when I decided I wanted to see if my application was leaking. So I ran Leaks and it found one right off the bat. But when I look at the stack trace the leak appears to happen in the main function when I call UIApplicationMain.

The image below shows the stack trace from instruments and the corresponding code in xcode. Does anyone know how I can stop this leak and why it’s happening?

alt text http://img193.imageshack.us/img193/1237/picture2fnj.png

EDIT: Ok I’ve searched and searched and got to where the problem is, but I still don’t know what’s going on. I’ve included the source for the TableViewController I’m having problems with.

The leak happens when I set the cell.text to [names objectAtIndex:indexPath.row]. Whats interesting is that it’s NSIndexPath that appears to be leaking somehow. How should I be managing memory with the objectAtIndex method?

On an unrelated topic, is editing my question post the best way to reply? Or should I have posted my code in a comment?

@implementation PersonListTableViewController


- (id)initWithStyle:(UITableViewStyle)style 
{
    if (self = [super initWithStyle:style])
    {
    NSString *path = [[NSBundle mainBundle] pathForResource:@"TwitterUsers" ofType:@"plist"];  
    names = [[NSArray alloc] initWithContentsOfFile:path];
    }
    return self;
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 
{   
    return 0;
    //return [names count];
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
    }

    cell.text = [names objectAtIndex:indexPath.row];

    return cell;
}

- (UITableViewCellAccessoryType)tableView:(UITableView *)table accessoryTypeForRowWithIndexPath:(NSIndexPath *)indexPath
{
    return UITableViewCellAccessoryDisclosureIndicator;
}


- (void)dealloc {
    [names release];
    [super dealloc];
}


@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-11T20:58:00+00:00Added an answer on May 11, 2026 at 8:58 pm

    Are you running the tools on the device or the simulator? I’ve found that memory issues can be different between the two.

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

Sidebar

Ask A Question

Stats

  • Questions 153k
  • Answers 153k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer By default, readers will try and parse your data unless… May 12, 2026 at 10:23 am
  • Editorial Team
    Editorial Team added an answer @karim79's code should work. Here, I wrote a proof of… May 12, 2026 at 10:23 am
  • Editorial Team
    Editorial Team added an answer Types of application social (so/twitter/wiki) games information (weather/news/blogs) communication (irc/chat/email,… May 12, 2026 at 10:23 am

Related Questions

So I'm getting a new job working with databases (Microsoft SQL Server to be
So I have a Sybase stored proc that takes 1 parameter that's a comma
So I'm embarking on an ASP.NET MVC project and while the experience has been
So I've got a JPanel implementing MouseListener and MouseMotionListener : import javax.swing.*; import java.awt.*;
So I wrote some perl that would parse results returned from the Amazon Web

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.