0

In my CoreData app, all inverse many-to-many relationships have a relationship fault. -- observed using NSLog(@"%@", [self description]) . The fault appears after data is saved and subsequently opened.

The relationship delete rule might be the culprit.

Here is an example.

Person
friends<<--->>  (An inverse many-to-many relationship on self.
addresses<<--|  (A many-many relationship to Address
             |
Address      |
owners<<-----| (A many-many relationship to person.address Addresses can be shared

The Address.owners relationship is set to deny. The Person.addresses relationship is set to nullify. The Person.friends relationship is set to deny.

I'd appreciate some clarification:

Given an easier case, where address is NOT shared.

AddressBoook    Person         Address
    people-------->addresses---->>owner

Person.address is set to Nullify. (Remove the address(es) only when the owner is removed) the Address.owner is set to .... No action. (Dont want to delete the person. Or nullify? Because Person is still held by AddressBook object

  • What are we deleting, the relationship or the owning object.
  • In a many-many relationship, can we consider, Nullify to occur on the removal of the last object -- or the first one and thus dangling those others in space. It must be the deletion of the Set!.

Thanks

Gabe Rainbow
  • 3,658
  • 4
  • 32
  • 42
  • What is the error you're actually seeing? "Fault" is a normal Core Data condition and doesn't indicate that anything is wrong. – Tom Harrington Apr 25 '13 at 19:09
  • i see `relationship1 = "";` while others of the exact same relationship are `relationship2 = ( );` – Gabe Rainbow Apr 25 '13 at 19:57
  • 1
    That is not an error, that's a completely normal part of the Core Data faulting process. Are you unable to get to the data at the other end of that relationship? – Tom Harrington Apr 25 '13 at 20:16
  • Ys, Its possible to get to the data via an nsarraycontroller with ContentSet bound to parent. Nevertheless, the confusing aspect: why are other relationships with the same rules show null instead of fault. – Gabe Rainbow Apr 25 '13 at 20:43
  • Aha. I think i got it. "Faulting is a mechanism Core Data employs to reduce your application’s memory usage." The two many-many 'fault' relationships are the ones with the largest footprints. 1. images. 2. self. – Gabe Rainbow Apr 25 '13 at 20:48

0 Answers0