Question

In my core data model I have an entity with an attribute of type Date. The date is stored by core data as a timeInterval since x. x being a reference date that core data uses. The problem is that the dates where entered manually as actual date strings instead of time intervals (I know the data should not be directly manipulated). My question therefore is: Is there a way I can directly get the data as a string (as it is stored by core data)? ValueForKey keeps returning a default date which is "2001-01-01 00:33:20 +0000" because it is failing to convert the data stored into an NSDate object. I do not want to change the attribute type from Date to String for a particular reason. Thank you!

Was it helpful?

Solution

Accessing the raw data stored by core-data is not possible through the core-data framework. You could however view the database contents directly. (Or maybe use sqlite if you have an sqlite core-data storage... interesting)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top