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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:06:36+00:00 2026-05-14T07:06:36+00:00

I have a list of items with a plus button in the navigation bar

  • 0

I have a list of items with a plus button in the navigation bar that opens up a modal window containing a table of the models attributes, that displays a form when the table items are clicked (pretty standard form style). For some reason if I click the plus button to open the form to create a new model, then immediately click the done button, the person model is saved. The action linked to the done button does nothing but call on a delegate method notifying the personListViewController to close the window.

The apple docs do state that the model is not saved after calling the insertNewObjectForEntityName: …

Simply creating a managed object does not cause it to be saved to a persistent store. The managed object context acts as a scratchpad.

I am at a loss to why this is happening, but every time I click the done button I have a new blank item in the original tableView.

I am using SDK v3.1.3

// PersonListViewController - open modal window
- (void)addPerson {
    // Load the new form
    PersonNewViewController *newController = [[PersonNewViewController alloc] init];
    newController.modalFormDelegate = self;

    [self presentModalViewController:newController animated:YES];
    [newController release];
}

// PersonFormViewController
- (void)viewDidLoad {
    [super viewDidLoad];

    if ( person == nil ) {
        MyAppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
    self.person = [NSEntityDescription insertNewObjectForEntityForName:@"Person" 
                                                    inManagedObjectContext:appDelegate.managedObjectContext];
    }

    ...

    UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone
                                                                              target:self action:@selector(done)];
    self.navigationItem.rightBarButtonItem = doneButton;
    [doneButton release];
}

- (IBAction) done {
    [self.modalFormDelegate didCancel];
}

// delegate method in the original listViewController
- (void) didCancel {
    [self dismissModalViewControllerAnimated:YES];
}
  • 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-14T07:06:36+00:00Added an answer on May 14, 2026 at 7:06 am

    If you are using a fetched result controller, it updates itself based on the state of the context. The store is not updated until you call save: on the context, but the context itself absolutely is (it would make no sense otherwise).

    Also, by default, when you close your application (if you used the CoreData template), it will save the current context, so these changes will persist.

    If you don’t want your table view to pick up the changes, you must delete the new entity from the context before returning to the previous view, or use two separate contexts (I urge you /not/ to chose this method unless you understand 100% how CoreData works).

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

Sidebar

Related Questions

I have a div containing list items, a photo, and a plus/minus icon at
I have a list of items that I am displaying in a floated list,
I have a list of items that I wish to display with a separator
In my viewmodel, I have a list (ObservableCollection) containing items. In the view, this
I have list items that have a HorizontalScrollView in each of them. Hence, I
I have list of items that I want to display in Canvas using data
I have a list of items (containing integer ids). I need to delete all
Lets' say we have list of items, each item has (unknown)number of attributes. Sorting
I have a list which is dynamically built, but there are empty list items
Can someone suggest what I am doing wrong? Basically I have a List Items,

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.