Fetched Properties - Predicate

北慕城南 提交于 2019-12-01 01:35:37

I had used a preloaded sqlite Database, which I copied from the bundle path at first launch and used to save user edits.

There's nothing wrong with shipping with pre-loaded data, per se. You should probably just ship a JSON file in the bundle and on initial app load, parse it and import it into Core Data. That will simplify what you're trying to do and won't be objectionable to Apple. The rest of your question becomes irrelevant if you do that. There's more than one way to do it.

Also, is there a reason you make Favorite its own entity? Why can't you just create a bool on the book entity called 'isFavorite'?

subqueries need a relationship which we do not have here. So that wont work in my opinion. You could switch the entity in your fetchedResultsController retrieve the data you need via a fetched property to the related books object. If to save time you can (as you do already) store the most relevant data for you to display in the tableview within your favorite object and retrieve additional data only if the user selects a cell and you go into a detailed view.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!