Core Data info & error in console at runtime Core Data info & error in console at runtime ios ios

Core Data info & error in console at runtime


I experienced this when running on my device with an app I am building. It has worked perfect for weeks and then all of a sudden this error. I figured out that it is due to a lack of memory available on the device. I use a little app call "System Status" that allows you to view the memory stats and release any old unused memory. I only get this error in Xcode when I have less than 5% available memory on my device. Therefore it cannot load the cache file the app is request, hence the error. Either close all your multitasking apps and restart your device or get the app and free you memory.


After some testing/debugging (sorry for the delay), I have at least a temporary solution.

Because of the multi-threaded saving process of Core Data, I found it a little tricky to identify the exact error location, but it definitely appears that the error occurs when Core Data is trying to save one of the context in the stack (probably the last "root" one).

As each save take a few seconds (without freezing the UI :p) , I figured the error could be generated by a "save overlap".

So even if I do not have enough to be sure, reducing the save frequency effectively solved my problem: no message anymore in the output.

Now there still is a hitch, and any expert answer would be much appreciated!


Uninstalling the app from the device and installing it again removes this error message.

Note that that doesn't fix the problem if you can see this log from earlier versions of your app that is already on your users' devices. It's generally okay to uninstall-install, though, if you're only seeing this during the development phase.