4 ms·
> if you are saving more than 3 objects to disk without linking to CoreData.framework, you’re doing it wrong. That's a pretty broad stroke (that I'm, admittedl
by Aqua_Geek 14y ago
> if you are saving more than 3 objects to disk without linking to CoreData.framework, you’re doing it wrong.
That's a pretty broad stroke (that I'm, admittedly, unfairly singling out).
Core Data works great in apps where you're dealing with a limited number of entities and displaying them in table views full of repeated cells (NSFetchedResultsController FTW!).
Once your entity graph gets fairly complex, however, things start to fall apart rather quickly. Child contexts? In theory, they're awesome. But we've ran into a number of nasty cases where objects were getting over-released on cleanup of the context. Error messages are less than helpful, merging model changes is a nightmare, batch deletion sucks, splitting data into multiple stores is way too complex - the list goes on.
The biggest problem I have with Core Data is that there is just not enough "best practices"-type documentation out there. The WWDC videos and everything else from Apple do a good job of getting people to get in the pool. But then you have a pool full of people who don't know how to swim and are now drowning.
Two weeks ago, I rewrote a third party library, because it didn't account for the fact that the app itself might be using Core Data as well (shock!). Among many other things, it was grabbing any model files it could find in the whole app bundle instead of specifically searching for its own, causing migration issues.
The sooner Apple admits that Core Data is a mess and moves on, the better off the ecosystem will be.
- icodestuff 14y ago> Child contexts? In theory, they're awesome. But we've ran into a number of nasty cases where objects were getting over-released on cleanup of the context. This is a known ARC bug. Implement -dealloc and nil out the managed object ivar (or property) and MOC ivar (or property), in that order. > The biggest problem I have with Core Data is that there is just not enough "best practices"-type documentation out there. I wholeheartedly agree.
- nicw 14y agoThis halfway-in,halfway-out implementation is what frustrates me. Those people who are drowning get the same answer "Well, Core Data isn't a relational DB so you shouldn't treat it like that." But yet all of Apple's nomenclature screams RDBMS.