5 posts with this tag

Progressive Core Data Migrations

February 04, 2019

There are very few certainties in app development, but one is that once your app is released it will change in unexpected ways. And no matter how flexible your architecture is, inevitably one of those changes will be a breaking change [https://en.wiktionary.org/wiki/breaking_change]. Perhaps the most important breaking changes involve the user's data. If your app loses or corrupts user data you can expect at least some reputational damage and if the loss is severe enough you can end up doing you…

Can Unit Testing and Core Data become BFFs?

April 02, 2018

Core Data and Unit Testing haven't always been the best of friends. Like two members of the same friend group who don't really know each other but really like their UIKit friend, Core Data and Unit Testing have in fact discovered that they have a lot in common and have gradually got more and more friendly with each other. But before we delve into how they can take it one step further and become firm friends, we need to understand what makes each of them tick. Getting to know each other Core…

Step-by-step Core Data Migration

November 30, 2017

> This post is now out-of-date, please instead see: "Progressive Core Data Migration" [https://williamboles.com/progressive-core-data-migration/]. People really care about their possessions. Nowhere do you see this more than on public transport. It's not unusual to see bags occupying seats while people stand. As a Brit, we have developed a powerful non-verbal based form of communication to indicate that you want someone to move their bag - maybe a slight shuffle, eye contact with other standin…

Saving and retrieving data from NSUserDefaults

September 26, 2011

NSUserDefaults is a great way to save small amounts of data that you want to persistent across application "sessions" (especially where a database would be overkill). Saving data: [[NSUserDefaults standardUserDefaults] setBool:YES forKey:KEY_TO_IDENTIFY_INFORMATION]; In the above, we save the value: YES with the key: KEY_TO_IDENTIFY_INFORMATION Retrieving data: [[NSUserDefaults standardUserDefaults] boolForKey:KEY_TO_IDENTIFY_INFORMATION]…

Core Data terms

March 11, 2011

I'm often asked to explain Core Data to the new joiners. I thought I'd share what I tell them about the components that make up Core Data: 1. Persistent store - is where Core Data stores its data, more often in a form of a SQLLite database but can be Atomic (binary store) or In-Memory. 2. NSPersistentStoreCoordinator - controls access to the persistent store - save, retrieve and search. 3. NSManagedObjectModel - representation of data model in memory, can combine multiple p…