I'm new to Core Data, and am struggling with some of it conceptually (relative to, say, SQL, which I understand).
I'm trying to build a model which for the sake of simplicity looks like:
"Category" entity, which has a name, and a relationship to-many Products
"Product" entity, which has a name
I want those name
s (string) in both entities to store localized variants. That implies another join. There are a small number of possible localizations. I know that I could put each localization as an individual attribute ("name_en", "name_de", etc), but that doesn't scale, and I want to understand the "right" way of accomplishing this.
My gut tells me I want two more entities here, a Localizations one (which simply contains the set of possible localizations) and some sort of LocalizedString one, which related to the Localization. But Xcode warns me about not having Inverse relationships set up, etc.
Can someone who groks Core Data model design deeply please help out a newbie understand how to think through this problem?
(My next problem will be building the weirdly multi-pivoted UI that lets you set the name for each localization that's available, but that will be another set of investigation. :) )
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…