Let’s say I have an entity called EntityA. EntityA has a relationship to EntityB and EntityC. Neither of EntityB and EntityC are mandatory relationships but one of them has to be chosen.
Is it possible to model this in Core Data?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If EntityB and EntityC had a common super-class, you could have a required relationship of that type.
That said, I have heard it said you should stay away from class hierarchies in Core Data.
YMMV