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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T05:33:31+00:00 2026-05-21T05:33:31+00:00

I have UIView designed in IB, and UITableView on it. In view contoller’s viewDidLoad

  • 0

I have UIView designed in IB, and UITableView on it. In view contoller’s viewDidLoad method I init my custom UITableViewContoller and sets dataSource and delegate:

- (void)viewDidLoad {
    [super viewDidLoad];
    ...
    GoodsTableController *goodsController = [[GoodsTableController alloc] init];
    goodsController.data = [[orderData objectForKey:@"Result"] objectForKey:@"Items"];
    self.gtc = goodsController;
    [goodsController release];

    goodsTable.delegate = self.gtc;
    goodsTable.dataSource = self.gtc;
    [goodsTable reloadData];}

Intresting in GoodsTableController:

//in the header file
@interface GoodsTableController : UITableViewController {
        NSMutableArray *data;
}

@property (nonatomic, retain) NSMutableArray *data;

//implementation

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
        NSLog(@"Current data size %d", [data count]);
        return [data count];
}
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
        if (editingStyle == UITableViewCellEditingStyleDelete) {
                NSLog(@"Deleting row at index %d", indexPath.row);
                [self.tableView beginUpdates];

                [self.data removeObjectAtIndex:indexPath.row];
                [self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];

                [self.tableView endUpdates];
                [self.tableView reloadData];
        }
}

For debug I used NSLog, and I saw that array was changed, its size was changed, tableView:numberOfRowsInSection was called, but table don’t update. Row don’t hides. That is log:

2011-04-07 13:08:18.784 Test[32300:207] Current data size 2 //first call tableView:numberOfRowsInSection: by reloadData in View Controller after set data
2011-04-07 13:08:23.486 Test[32300:207] Current data size 2 //call after slide on row
2011-04-07 13:08:26.091 Test[32300:207] Deleting row at index 0 
2011-04-07 13:08:26.093 Test[32300:207] Current data size 1 //call after endUpdate
2011-04-07 13:08:26.096 Test[32300:207] Current data size 1 //call after reloadData
  • 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-21T05:33:32+00:00Added an answer on May 21, 2026 at 5:33 am

    The problem was in undefined tableView in GoodsTableController instance.
    Fixed code:

    - (void)viewDidLoad {
            [super viewDidLoad];
            ...
            GoodsTableController *goodsController = [[GoodsTableController alloc] init];
            goodsController.data = [[orderData objectForKey:@"Result"] objectForKey:@"Items"];
            self.gtc = goodsController;
            [goodsController release];
    
            goodsTable.delegate = self.gtc;
            goodsTable.dataSource = self.gtc;
    
            //Fix there:
            self.gtc.tableView = goodsTable;  
            [goodsTable reloadData];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UIView with a UITableView for a subview. The UIView has an
Hi I have a UIView which contains several buttons that are designed by others
I have create a view based application and its loaded correctly what i designed
I have a UIView in which I added a UITapGestureRecognizer . Inside that view
I have a UIPickerView, in it's delegate I'm trying to customize the view for
I have a UIView subclass that I am doing some custom drawing in. When
I have a UIView (created in IB) with a grouped UITableView as a subview.
I have a ViewController with a nib which have a UIView and a UITableView
I have a UIView that I am setting as the property of a UITableView
I have a view that contains a UITableView and a UILabel which works perfectly

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.