I have two entities in CoreData Todo and DaysOfYear and a many to one relationship exists between these two entities. When the user launches the app if for the past 4 days the user has not completed any of the todos I add those todos to the incompleteTodos relationship for each day. Thing is only the first day gets updated in core data while the rest of them do not update. I have tried everything that I could, all to no avail. Core Data simply refuses to store any of the updates I make except for the first day even though context.hasChanges acknowledges that the context has changed. ContentView from where I add IncompleteTodos: Todo.addIncompleteTodo(todo: todo, for: days[idx].date, context: context) Extension Todo:static func addIncompleteTodo(todo: Todo, for day: String, context: NSManagedObjectContext) { let today = DayOfYear.withDate(convertStringToGMTDate(day), context: context) todo.incompleteDay = today today.addToIncompleteTodos(todo) print(context.hasChanges) try? context.save() } E
0
0
391