Skip to content

Instantly share code, notes, and snippets.

@zwaldowski
Created August 23, 2012 21:39
Show Gist options
  • Save zwaldowski/3442218 to your computer and use it in GitHub Desktop.
Save zwaldowski/3442218 to your computer and use it in GitHub Desktop.
AZCoreRecord setup info

The local store is for local-only things, generated objects that shouldn't be synced. A ubiquitous store is never used until iCloud is enabled. The fallback store is used for everything that would otherwise be in iCloud, including when iCloud is never enabled. This is probably a mis-naming on my part. I'm open to suggestions.

The local store is added immediately the first time AZCoreRecordManager's managed object context or persistent store coordinator is accessed. Because the fallback and/or iCloud store might take longer, they are done later.

This technique is based off of Session 227 of WWDC 2012.

A typical initialization might look like this:

	AZCoreRecordManager *crm = [AZCoreRecordManager sharedManager];
	crm.stackModelConfigurations = @{
		AZCoreRecordUbiquitousStoreConfigurationNameKey : @"UbiquitousStore",
		AZCoreRecordLocalStoreConfigurationNameKey : @"LocalStore"
	};
	crm.stackShouldAutoMigrateStore = YES;
   	crm.ubiquityEnabled = YES;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment