objective c - Core Data: An Inverse Relationship to multiple entities? -


Assume that I have 4 entities in my data model: person, car, pet and photo. I want a relationship with the car and the car in the photographic unit of the person, in which I like all those things to keep a picture of that thing. So far, there is no problem, however, where it becomes difficult, it is an inverse relationship, where the photo unit wants to tell the attached item back. I would not want to have any inverse relationship either, so only one attribute in the photo will be UIImage, or maybe an attached engagement will be inverted relationship if I do this, then I select one of those items to attach my relationship. I can do

Would it be better to leave it as a unidirectional relationship? Maybe I can make an intangible unit called "etabble itam" and the person can make the car and the stomach as children of it, then tell my inverse relationship to the AttachableItem I'm not sure how best it will be .

I will make an intangible entity photo and the personPhoto, carphotos and petphoto institutions will have photos with their original unit Shows as

The order of the person, the car, and the stomach will be respectively with the person photo, carphoto and stomach photo. After this, there was an inverse relationship with person, car and stomach in person photo, carphoto and stomach photos respectively.

There will still be an attribute in the photo unit. You can store images in files in your app's Documents directory and save the file name as this feature. In this approach, it is recommended that alternatively, you can directly form the core data in UIImagePNGRepresentation () or UIImageJPEGRepresentation () .


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -