I am new to CoreData and apologize in advance if the question is difficult to understand. So... Assuming we have two entities - Cars and Items (one to many relationship). I have 2 objects in cars (let§s say... BMW and Audi) and want to add a new item to Audi. How to select the Audi entity in which to add new item object? I know how to add new instance of item, but how to associate them to the specific entity... let say of Audi?
let entity = NSEntityDescription.entity(forEntityName: "Cars", in: context)
let newItem = NSManagedObject(entity: entity!, insertInto: context) as! Item
newItem.type = "Oil"