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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:19:09+00:00 2026-06-01T03:19:09+00:00

I just create a simple UITableView in the UIViewController . .h #import <UIKit/UIKit.h> @interface

  • 0

I just create a simple UITableView in the UIViewController.

.h

#import <UIKit/UIKit.h>

@interface RootController : UIViewController <UITableViewDataSource>
{
    NSMutableArray *_tableData;
    UITableView *_tableView;
}
@end

.m

#import "RootController.h"

@implementation RootController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        if (!_tableData) {
            _tableData = [[NSMutableArray alloc] initWithCapacity:20];
            for (int i = 0; i < 50; i++) {
                [_tableData addObject:[NSString stringWithFormat:@"%d", i]];
            }
        }
    }
    return self;
}

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

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)loadView
{
    UIView *view = [[UIView alloc] initWithFrame:[UIScreen mainScreen].bounds];
    self.view = view;
    [view release];

    self.view.backgroundColor = [UIColor whiteColor];

    if (!_tableView) {
        _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 320, 460)];
        _tableView.dataSource = self;
    }
    [self.view addSubview:_tableView];
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

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

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *cellIdentifier = @"TableViewCellIdentifier";
    UITableViewCell *cell = nil;
    cell = [_tableView dequeueReusableCellWithIdentifier:cellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier] autorelease];
    }

    cell.textLabel.text = [_tableData objectAtIndex:indexPath.row];

    return cell;
}

@end

I used instruments to detect memory leak for this, when I scrolled the UITableView, memory
leak occurred.
enter image description here

I use Xcode 4.3.1 and iOS5.1 (iPod touch4).
Someone had this problem?

  • 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-06-01T03:19:10+00:00Added an answer on June 1, 2026 at 3:19 am

    If you look at the ‘responsible library’ column, you can see that the culprit is not your code. The leaks are small, you can safely ignore them.

    Here is a similar question: WebView: libdispatch leaks in an ARC-enabled app

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

Sidebar

Related Questions

I'm trying to create a very simple REST server. I just have a test
I'm looking for as simple way to create an identity set. I just want
Just trying to create a simple method that counts up 1 on the tally
I'm new to cakePHP.I just tried to create a simple form with a text
How can I create a simple maven project using m2e ? I just need
I just create a simple Graph Source Filter [ MPEG4 || H264 ] ---->
I have a UIViewController which uses the UITableViewDelegate and UITableViewDataSource. I have created UITableView
I am using Rails 3. I just want to create a simple javascript object
By following example from em-websocket gem, I've just create simple echo-server that running with
I create simple test PDF document using iTextSharp. I'm just using PdfContentByte to show

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.