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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T00:50:16+00:00 2026-06-17T00:50:16+00:00

I have a program in which I’m using CoreData to manage both permanent and

  • 0

I have a program in which I’m using CoreData to manage both permanent and temporary data.

In one instance, I abort the addition of some data by deleting the object when the user presses cancel. But when I hit the next view, the data is still there, attached to it’s parent core data object.

    [self.bar removeFoosObject:self.foo];//Why do I need this line?
    [self.foo.managedObjectContext deleteObject:self.foo];

I eventually solved this by manually removing the child object from it’s parent — but isn’t that something core data handles automatically? Why should I need the first line?

I ran some test code, and Foo is definitely deleted — the code that it was mucking up let me check, and it’s MOC has been set to nil. The memory exists, but it should be very, very dead…

  • 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-17T00:50:18+00:00Added an answer on June 17, 2026 at 12:50 am

    You have to manually do this because you have your deletion rules set wrong. Check the Relationship Delete Rules in the following apple documentation.

    https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CoreData/Articles/cdRelationships.html

    Or it could also be that the relationship is NOT set as optional between the parent and child object.

    And also after you delete the object you should save the database to synchronize it.

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

Sidebar

Related Questions

I have a program which creates a timer using timerfd_create (the timer when it
I have a program which needs to turn many large one-dimensional numpy arrays of
I have a program which creates multiple threads and each one of them tries
I have a program which shells (using ShellExecute) Adobe Reader to open an FDF
We have a program which produces PDFs by merging data in FDF files with
I have a program which accepts 2 N -digit numbers, multiplies them using threads
I have a program which would use the Application Role to write data to
I have a program which transmits(broadcasts) and receives UDP packets simultaneously using pthreads. What
I have program which reads MSMQ using GetAllMessages but it does not remove messages
I have a program which is able to retrieve various registry values using C#

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.