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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:45:22+00:00 2026-06-01T07:45:22+00:00

I have trouble with adding new row to my UITableView. I read similar questions

  • 0

I have trouble with adding new row to my UITableView. I read similar questions on stackoverflow, googled it, … didn’t help me.

I have empty NSMutableArray *dataForList with data for UITableView. After click on screen I want to add new row. This error shows:

* Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘attempt to insert row 0 into section 0, but there are only 0 rows in section 0 after the update’

Code:

NSArray *insertIndexPaths = [NSArray arrayWithObject: 
                             [NSIndexPath indexPathForRow:
                              [self.dataForList count] // is zero now
                              inSection:0]];

[self.dataForList addObject:newRow];
// [self.dataForList count] is 1 now

[self.unsignedTableView beginUpdates];
[self.unsignedTableView insertRowsAtIndexPaths:insertIndexPaths withRowAnimation:UITableViewRowAnimationNone];
[self.unsignedTableView endUpdates]; // on this line error ocours

What am I missing?

All UITableView methods

- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *) indexPath {}

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

- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger) section {
return [self.mainController.dataForList count];
}

- (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *) indexPath{
return 38.0f;
}

- (UITableViewCell *) tableView: (UITableView *) tableView
      cellForRowAtIndexPath: (NSIndexPath *) indexPath {
// call render method in view, it works fain
return [self.signUpToTestView renderUnsignedCell:tableView cellForRowAtIndexPath:indexPath];
}
  • 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-01T07:45:24+00:00Added an answer on June 1, 2026 at 7:45 am

    are you changing the numberOfSection and numberOfRowsInSection according to your array after clicks?

    return [arr count];
    

    and also try reloading the table

     [table reloadData];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im have a slight amount of trouble adding a new view to my scene,
I am having trouble adding Widgets to my homescreen. I have created a new,
I have trouble with getting page source. require 'mechanize' agent = Mechanize.new page =
having a bit of trouble adding some data to a database. I have the
I am a very new java user, and I have always had trouble with
I'm having trouble merging a branch back to the trunk after adding a new
I have trouble understanding what minimal effort is needed on my part in removing
I have trouble comparing 2 double in Excel VBA suppose that I have the
I have trouble with the following piece of code. When I go through with
I have trouble using Perl grep() with a string that may contain chars that

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.