I have a server API that returns me the same Item object, under 3 different endpoints:
- /new/
- /recommended/
- /library/
The same Item could appear in both new and recommended lists.
I need to somehow track which items come from which endpoints, to show them as 3 different screens, while maintaing one big pool of items in database. What would be a good model for this?
You could do some ultra normalization, but if you think that these are the only three classifications, you could just add them as boolean fields of your entity and mark each field as checked depending on which endpoint it came from. Here are some steps:
When you perform your fetch in each of your views, just set your predicate to something like one of these:
[NSPredicate predicateWithFormat:@”new = 1″];
[NSPredicate predicateWithFormat:@”recommended = 1″];