Answer the question
In order to leave comments, you need to log in
How to inherit attribute value of parent Entity?
There are two non-abstract Entities, one is specified by the parent of the second. We create an object of the parent Entity and set the values to the attributes. Then we create an object of the child Entity. How to pass parent object attribute values to child object?
Car *car = [NSEntityDescription insertNewObjectForEntityForName:@"Car"
inManagedObjectContext:dataManager.managedObjectContext];
car.mark = @"Opel";
car.model = @"Zafira";
ClientCar *clientCar = [NSEntityDescription insertNewObjectForEntityForName:@"ClientCar"
inManagedObjectContext:dataManager.managedObjectContext];
//Хочу что сделать что то подобное
clientCar = (ClientCar *)car;
clientCar.date = [NSDate date];
//Или как то так, но не думаю что это верное решение
clientCar.mark = car.mark;
clientCar.model = car.model;
clientCar.date = [NSDate date];
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question