Core Data Reading List

As I attempt the journey to make the jump from a Junior Level iOS Developer to intermediate, I have found part of that journey to be understanding Core Data.

Core Data in layman’s terms is the current standard for adding persistence to your iOS application. (I can’t wait till everyone moves to Realm =]).

When using Core Data, there are so many possible pitfalls due to not its flexibility, not understanding the possible concurrency issues and outdated best practises.

Below is the Reading List that helped me come to grips with Core Data.

Intro to Core Data

Overview of Handling concurrency issues

New API’s For Core Data

Core Data Strategies

Tips

  • When using NSFectchedResultsController, don’t forget to call performFetch or you will get no data and no errors lol.
  • Core Data isn’t just like an abstraction over SQLite. It’s a lot more. It’s built for how you would handle models in a mobile application. For example, denormalized data. If you want to store the number of books written by an author; store the count instead of fetching all the books and counting the objects.
  • Fetches are expensive! Minimize them.
  • There isn’t an UpdateOrInsert Method, you have to write your own if need be. Fetch all the objects and store in memory (using a Dictionary — for O(1) Lookup) so you don’t have to perform a fetch in order to check if an object already exists.
  • Load test your applications when using Core Data. Very important!
  • There’s a lot of outdated information so limit your stackoverflow searches to the last year or so. If you see anything about thread confinement, thats outdated!
  • Maybe try out Realm (https://realm.io/) !