-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inverse Relationships #11
Comments
Hey, The test in question is in CoreValueTests.swift:
|
It doesn't crash because you have two relationships between Employee and Shop (in core data) - shop and work. The core data is confused and populates the other relationship which you don't unbox in the StoredEmployee entity. Change it and you should see the crash. |
Is there any development in this case? Because I'm interested how do inverse relationships work and if they do. |
I've tried many way to deal with inverse method, and try to find in the sample. But still can not find an appropriate way to deal with it. For example, I can not try to save employee with a shop, which cause a big inconvenience. var shop = Shop(objectID: nil, name: "Carpet shop", employees: nil) try! employee.save(context) |
Hi,
I started using modified version of CoreValue on one of my projects and one problem with CoreValue became imminent.
The Employee have inverse relationship with Shop. When I add employee to the Shop entity and save the corevalue will populate the inverse relationship. When I try to query the Shop program will crash in infinite loop.
This is of course logical, because we are working with structs, but it gets quite limiting. The solution is to not to unbox the inverse relationship but I found out that sometimes I need to use both sides of relationship.
I wonder if you are aware of the problem and if you have and idea how to solve it
Thanks
The text was updated successfully, but these errors were encountered: