Monday, October 1, 2018

iOS 12 and Core Data External Binary Data Storage


On iOS 12, binary data stored in Core Data with the External Storage option gets corrupted/goes missing on every second save of the context.

Others seem to be encountering the same issue. External storage is so convenient, but it seems to be a continual source of problems and bugs.

Previously: Core Data, External Binary Data Storage, and Migration.

Update (2018-10-02): See also: Hacker News.

Update (2018-10-04): See also: some Twitter discussion.


Language bindings are a minor issue - here’s my POV: I have to ship a reliable product. With data loss like external stores disappearing I’m SOL, and it’s in a codebase that I cannot fix or guarantee a fix to. Sure, my SQLite model will be slower, but correct


I can live with slower, even an order of magnitude so, over data loss. The business costs are huge for the latter. Even the emotional costs, what if I lose someone’s pictures of a deceased loved one? There’s a human on the receiving end of my program most of the time...

Drew McCormack:

Ouch! Just got bitten by a serious Core Data bug in macOS 10.14 and iOS 12 with external binary storage. Firefighting all day to save my user’s data.

It’s in an old app (Studies). Created the model about 10 years ago. I’ve learnt my lesson with external binaries.

Ensembles is not affected.

Ilja A. Iwas:

There are days when I wonder if it was worth coming up with our homegrown CoreData replacement. And then there are days like today.

The Omni Group wrote OmniDataObjects because Core Data was originally not available on iOS, and OmniFocus continues to use it.

Ilja A. Iwas:

If Apple doesn’t allocate enough resources for screening incoming bug reports during their beta phase, sticking to a yearly macOS release schedule is not responsible to users and developers. Small indy devs probably don’t recover from such hits.

It looks like NSBatchDeleteRequest also doesn’t work with external binary data.

Update (2018-10-05): Colin Cornaby:

So we’ve done our best to try and repro the iOS 12/Core Data External Binary Storage bug in our apps… and we can’t.

I’m not saying the bug doesn’t exist. I know it does. I just don’t know why we can’t repro it in our apps, and it’s driving me crazy.

2 Comments RSS · Twitter

would be interesting to know if a radar was filed before GM and Apple chose to ship anyway...

Does this affect macOS 10.14?

Bob— I filed radar 43702032 "Binary external storage broken in iOS 12?" on 8/24. And yes, the exact same problems occurred on Mojave until I turned off external storage in the Core Data model.

Leave a Comment