阅读背景:

处理Core Data中的重复条目

来源:互联网 

I have an app that allows users to save favorites. I am using Core Data to store the favorites as managed objects. I have written some code to prevent the possibility of storing duplicates, but am wondering if there is a better way to do so. Each favorite object has an ID field that is unique. In the following code I am simply looping through and checking the ID field, and if the value already exists, setting a flag value to true, and breaking out of the loop. I have an app that allows users to save favorit




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: