The user will have a static list of items to choose from. Using a Picker View they will choose one of the items and then select how many of them they want.
Whats the best way to save this in core data? A Struct?
struct order {
NSInteger item;
NSInteger numberOf;
};
Or some sort of relationship?
Many Thanks
In Core Data you would create an entity to model the users choices.
Assuming the item is just a name then you would have an entity something like this:
If items have their own entity, it would look like this:
For simple data without relationships, you can think of Core Data entities as simple structs. (In fact, under the hood, that’s what they are.)