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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:30:26+00:00 2026-05-20T08:30:26+00:00

I’m using core data and I have a simple two-entity model. My navigation controller

  • 0

I’m using core data and I have a simple two-entity model. My navigation controller has an “add” button that allows the user to add new school years to the database… (i.e. freshman year, sophomore year, etc…)

When the user clicks the add button, I call this function which pushes my simple data entry form onto the stack. Works great. User adds new school year and clicks the “done” button on the form. I pop that form off the stack and the user comes back to the main screen.

My problem is that the main screen (tableview) does not show the new entry in the table. How do I make the code refresh the table? Note: If I exit the simulator and relaunch it, the new record is then visible.

Here is the function I call when the user clicks the “+” sign to add a new school year.

- (void)addSchoolYear {

vcAddYear *addYearViewController = [[vcAddYear alloc] initWithNibName:@"vcAddYear" bundle:nil];

[self.navigationController pushViewController:addYearViewController animated:YES];
[addYearViewController release];

}

When the user is done adding the new record and then clicks on the “Save” button. Here is that function.

- (void)SaveButton {

    //get a pointer to the managedobjectcontext
GradetrackAppDelegate *AppDelegate = (GradetrackAppDelegate *)[[UIApplication sharedApplication] delegate];

managedObjectContext = AppDelegate.managedObjectContext;

Schoolyear *schoolyear = (Schoolyear *)[NSEntityDescription insertNewObjectForEntityForName:@"Schoolyear" inManagedObjectContext:managedObjectContext];

    // plug the user's data into a schoolyear record
[schoolyear setNameForThisYear: _nameYear.text];
[schoolyear setSchoolName:  _nameSchool.text];


NSError *error = nil;
if (![managedObjectContext save:&error]) {
    // Handle the error.
}

//[AppDelegate.delegateSchoolyearsArray insertObject:schoolyear atIndex:0];
[self.navigationController popViewControllerAnimated:YES];

return;
}

At this point, my code returns to the calling rootviewcontroller which is a tableview and the table looks just like it did before the user added the new record. How do I tell my tableview to reload and show the new data item along with the other old ones?

Many thanks.

  • 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-20T08:30:27+00:00Added an answer on May 20, 2026 at 8:30 am

    You could always use an NSFetchedResultsController.

    Here’s the documentation. Implement the delegate methods and away you go.

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I am doing a simple coin flipping experiment for class that involves flipping a
I have a French site that I want to parse, but am running into
I have thousands of HTML files to process using Groovy/Java and I need to
I'm making a simple page using Google Maps API 3. My first. One marker
I have some data like this: 1 2 3 4 5 9 2 6

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.