0

I have a bunch of code that sets Core Data relationships via the inverse instead of the "addWhateverObject" methods. This usually works well in all of my applications, but I have one app where the relationships are being lost when the NSManagedObject context is being saved.

My question is setting a relationship in Core Data via the relationship's inverse valid or do you have to use the accessor methods to add objects to the relationship?

Thanks!

miken.mkndev
  • 1,581
  • 2
  • 20
  • 37
  • have look http://stackoverflow.com/questions/764125/does-every-core-data-relationship-have-to-have-an-inverse – Prasad_R Sep 18 '13 at 04:48

1 Answers1

1

Yes, using the inverse is valid. Core data does all of the appropriate updating for you when you do that. See the comments on this question Core Data To-Many Relationship Creating Duplicates When Adding Object to Parent Entity

Community
  • 1
  • 1