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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:47:39+00:00 2026-06-12T16:47:39+00:00

Im pretty new at iOS programming, I’m trying to make this budget app. I

  • 0

Im pretty new at iOS programming, I’m trying to make this budget app. I want to add a instance class of my budget class to my tableview. But when I’m hitting the done button this error comes up. I’ve been searching the forum for an answer to my problem.

So fare I’ve found Aby how has the same problem as I (http://stackoverflow.com/questions/11706254/nsinternalinconsistencyexception-reason-attempt-to-insert-row-0-into-section?answertab=active#tab-top) but I can’t really get a clear answer/solution to my problem in that post.

I’m quit sure I know why this error happens, but how do solve it I don’t know 🙁
Any who can help me solving this problem?

I would like to post some pic of my code but stackoverflow will not allow me due to spam securing.

AddBugdetViewController.m

(IBAction)done
{
    [self.presentingViewController dismissViewControllerAnimated:YES completion:nil];

    Budget *budget = [[Budget alloc] init];
    budget.name = self.textField.text;
    budget.amount = [Budget convertStringToNSNumber:self.textField.text];

    [self.delegate addBudgetViewController:self didFinishAddingItem:budget];
}

BudgetViewController.m

(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return [self.budget.items count];
}

(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Budgets"];

    Budget *item = [self.budget.items objectAtIndex:indexPath.row];

    [self configureTextForCell:cell withChecklistItem:item];

    return cell;
}

- (void)addBudgetViewController:(AddBudgetViewController *)controller didFinishAddingItem:(Budget *)NewBudget
{
    NSLog(@"Adding budget: %@", NewBudget.name);
    NSLog(@"Budget amount: %@", NewBudget.amount);

    [self.tableView beginUpdates];

    int newRowIndex = [self.budget.items count];
    [self.budget.items addObject:NewBudget];

    NSIndexPath *indexPath = [NSIndexPath indexPathForRow:newRowIndex inSection:0];
    NSArray *indexPaths = [NSArray arrayWithObject:indexPath];
    [self.tableView insertRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationAutomatic];

    [self.tableView endUpdates];

    [self dismissViewControllerAnimated:YES completion:nil];
}

Please tell me if you need more information to track down the problem and solve it 🙂

Cheers Anders

  • 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-12T16:47:40+00:00Added an answer on June 12, 2026 at 4:47 pm

    Your BudgetViewController appears to define a property named ‘budget’. Whatever code is creating and displaying the BudgetViewController should set that property to whatever budget object should be displayed in the view controller.

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

Sidebar

Related Questions

I'm pretty new to iOS programming and I have this problem. I have a
I'm pretty new to iOS programming so sorry for any doh questions ;) I
I'm pretty new to IOS. I want to get all pictures on a device
Ok, I'm still pretty new to iOS development, so I apologize if this is
I'm pretty new at iOS dev, and I wonder how works this line :
First, let me say that I'm pretty new to Objective-C and iOS programming in
I'm pretty new to iOS development, and I want to figure out if there's
I'm very new to storyboarding (also pretty new to iOS programming in general). I'm
I'm pretty new to iOS animations, I've been trying to accomplish something that in
I have a pretty basic internal iOS app that I want to send a

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.