I managed to delete all objects stored using Core Data (after this answer ).
The problem is that I noticed that the primary key is still counting up. Is there a way (without manually writing an SQL query) to reset the Z_MAX value for an object? Screenshot below to clarify what I mean.
The value in itself is not a problem, but I'm just worried that at some point in the future, the maximum number may be reached, and I do not want this to happen. My application synchronizes data with a web service and caches it using master data, so the potential primary key can increase by hundreds / thousands at a time. Removing the entire Sqlite DB is not an option, since I need to save some of the information for other objects.
I saw the reset 'method, but of course will the whole Sqlite DB be reset? How can I reset the primary key only for this set of objects? There is no relationship with other objects with the main key that I want to use reset.

source
share