Skip to content
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

Relationship set returns empty #555

Closed
ourdex86 opened this issue Feb 11, 2019 · 8 comments
Closed

Relationship set returns empty #555

ourdex86 opened this issue Feb 11, 2019 · 8 comments

Comments

@ourdex86
Copy link

I have created two Entities Employee & Course. And, I have a One-To-Many relationship call courses.

Here is my JSON :

[{"name":"John","age":21,"courses":[{"courseName":"Computers","courseId":506},{"courseName":"Electronics","courseId":507}]}]

let dataStack = DataStack(modelName: "LibrariesDemo")        
        dataStack.sync(jsonArray, inEntityNamed: "Employee") { (error) in
            let employees = try! dataStack.viewContext.fetch(Employee.fetchRequest()) as! [Employee]
            print("Courses Count = \(employees.last?.courses.count)")
        }

With the above implementation, courses is always returning empty

@3lvis
Copy link
Owner

3lvis commented Mar 22, 2019

Strange, @ourdex86 do you still need help?

@ourdex86
Copy link
Author

Yes, I still didn't find the solution

@ali-ehsan
Copy link

Same issue

@ourdex86
Copy link
Author

@3lvis .. Are you checking this issue ?? :(

@3lvis
Copy link
Owner

3lvis commented Apr 17, 2019

Hi @ourdex86!

Looking at it now

@3lvis
Copy link
Owner

3lvis commented Apr 17, 2019

Hi @ourdex86 @ali-ehsan,

There must be something strange in your implementation, I gave it a try and it works fine. 😕

@3lvis
Copy link
Owner

3lvis commented Apr 17, 2019

#561

@3lvis 3lvis closed this as completed Feb 11, 2020
@3lvis
Copy link
Owner

3lvis commented Feb 11, 2020

Thanks for your support in this library. It has been a while since I used CoreData in any of my projects and it's hard for me to maintain this library. If you have been part of the Sync contributors group and want to take ownership of the library let me know to [email protected]. For now, I'll be archiving this library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants