NSPersistentStoreCoordinator subclass that supports an encrypted binary store type in Core Data. More...
#import <GDPersistentStoreCoordinator.h>
BlackBerry Dynamics applications can store Core Data objects in the secure store.
Using this class instead of the default NSPersistentStoreCoordinator
allows the use of the following additional Core Data store types.
GDEncryptedBinaryStoreType
NSBinaryStoreType
. GDEncryptedIncrementalStoreType
NSSQLiteStoreType
. URL
parameter will be an absolute path within the BlackBerry Dynamics secure file system.NSSQLiteStoreType
store to a GDEncryptedIncrementalStoreType
store. Use the Core Data migration API to do this.NSSQLiteStoreType
store file directly into the secure file system, and then use it as a GDEncryptedIncrementalStoreType
store.The following code snippets illustrate some common tasks.
- (NSPersistentStoreCoordinator *)persistentStoreCoordinator { if (__persistentStoreCoordinator != nil) { return __persistentStoreCoordinator; } // The URL will be a path in the secure container NSURL *storeURL = [NSURL URLWithString:@"/example.bin"]; NSError *error = nil; __persistentStoreCoordinator = [[GDPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]]; if (![__persistentStoreCoordinator addPersistentStoreWithType: GDEncryptedBinaryStoreType configuration: nil URL: storeURL options: nil error: &error] ) { abort(); } return __persistentStoreCoordinator; }