• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Searching for an entity in a relationship (CoreData)?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Searching for an entity in a relationship (CoreData)?


  • Subject: Re: Searching for an entity in a relationship (CoreData)?
  • From: Chris Hanson <email@hidden>
  • Date: Sat, 3 Dec 2005 19:57:08 -0800

On Dec 3, 2005, at 7:45 PM, Mike Nowak wrote:

But then I noticed it would get data for a year I had deleted in the UI. I tried changing the fetch request to use year == $year and stock = nil but that didn't make a difference. When I save the data in XML format, I can see that the Stock only lists the YearData entities I expect but the deleted YearData entity still points to the Stock entity. (I was surprised to see the deleted YearData entity in the saved file at all.) I tried various delete rules to unhook the deleted entity but to no avail.

A couple things come to mind. First of all, if your relationship maintenance is messed up even though you have inverses, I suspect you have a no-action delete rule somewhere. If you want deleting a YearData to delete the objects on the other side of its stock relationship, use a cascade delete rule on the stock relationship.

Also, if the YearData objects are still in the file, it sounds like they were only removed from relationships rather than deleted. This could be the case if you have YearData being shown in a table view managed by an NSArrayController that gets its data from a contentSet binding. The contentSet binding has a setting to indicate whether it should delete objects upon their removal; I believe this is off by default.

-- Chris

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: Searching for an entity in a relationship (CoreData)?
      • From: Mike Nowak <email@hidden>
References: 
 >Searching for an entity in a relationship (CoreData)? (From: Mike Nowak <email@hidden>)

  • Prev by Date: How to get NSText for custom NSCell in NSTable?
  • Next by Date: Re: Is Apple's singleton sample code correct?
  • Previous by thread: Searching for an entity in a relationship (CoreData)?
  • Next by thread: Re: Searching for an entity in a relationship (CoreData)?
  • Index(es):
    • Date
    • Thread