Hello,
I have an app where I user core data to organize product data. The idea is to let the user search for products. I use tableviews and navigationcontroller to let the user define the attributes to be used in the search.
The last step is where all the options the user have chosen, are supposed to be in a query in oder to get the products searched for.
I have defined some entities/managed objects like this and I am a bit confused about these relationsships.... Is this a better way to make this? I mean it must be a rather common and basic way to use data...?
(please look at the images attached here)
The problem is, I would like to make some kind of join/nested query on these objects but I do not understand how I can define this using predicates.
For instance:
The user has defined following values
- supplier_name (some company)
- product_name (type of product like Shirt)
- product_option_category (for instance Material, Color, etc)
- product_options_values (Material=cotton and Color= green or blue, etc)
Every Product has 1-N options and a Product_option has 1-N Product_values.
So how do I get the products having the chosen attributes? I understand its not like in a database, and I am abit confused about not useing foreign keys etc but it must be possible to sort and serach for data somehow...
Any ideas on this issue?
Thanks in advance!
MACloop
I have an app where I user core data to organize product data. The idea is to let the user search for products. I use tableviews and navigationcontroller to let the user define the attributes to be used in the search.
The last step is where all the options the user have chosen, are supposed to be in a query in oder to get the products searched for.
I have defined some entities/managed objects like this and I am a bit confused about these relationsships.... Is this a better way to make this? I mean it must be a rather common and basic way to use data...?
(please look at the images attached here)
The problem is, I would like to make some kind of join/nested query on these objects but I do not understand how I can define this using predicates.
For instance:
The user has defined following values
- supplier_name (some company)
- product_name (type of product like Shirt)
- product_option_category (for instance Material, Color, etc)
- product_options_values (Material=cotton and Color= green or blue, etc)
Every Product has 1-N options and a Product_option has 1-N Product_values.
So how do I get the products having the chosen attributes? I understand its not like in a database, and I am abit confused about not useing foreign keys etc but it must be possible to sort and serach for data somehow...
Any ideas on this issue?
Thanks in advance!
MACloop