Hi all,
I'm programming an app for an restaurant and want to show the restaurants menu in a sectioned table view. Above the table view I've got a UISegmentedControl which controls which Menu Section to display (Food or wine). The table should show the dishes separated by sections (pe. starters, meat, etc).
I've got 3 related entities MenuSections, MenuSubsections and MenuItems which are updated from a server (items change frequently) so I wanted to display the saved data and reload if the background process has downloaded any changes.
So far so good, but now I'm facing some problems when trying to retrieve the data.
- When initializing the controller I need to define "sectionNameKeyPath" which is in MenuSections.menuSubsection.name, but I get an error saying "to-many key not allowed here".
- I would like to sort both MenuSubsections and MenuItems, but again an error "to-many key not allowed here".
Can anyone shed some light on this as I were not able to find any info :-(
Thanks in advance, Miguel
UPDATE:
Items created in XCDataModel:
MenuSections:
id (int16)
name (string)
modified (date)
menuSubsections (relation to-many with MenuSubsections)
MenuSubsections:
id (int16)
name (string)
modified (date)
menuSections (relation to-one with MenuSections)
menuItems (relation to-many with MenuItems)
MenuItems:
name (string)
modified (date)
price (decimal)
menuSubsections (relation to-one with MenuSubsections)