SuperRecord icon indicating copy to clipboard operation
SuperRecord copied to clipboard

SuperCoreDataStack has no flexibility and doesn't support multi-threading

Open michaelarmstrong opened this issue 9 years ago • 1 comments

SuperCoreDataStack assumes your backing store is named the same as your App name. Additionally it uses the Apple boiler-plate and does not support any CoreData configuration other than a single main thread context.

Calls also require an explicit mention of either defaultStack or inMemoryStack... this pattern needs improving to a single line of setup in the AppDelegate on app launch.

It should firstly allow the user to specify which stack to use. Something like:

SuperCoreDataStack.setup(type: SuperRecordStackType, storeURL: NSURL = someDefault)

So you can do...

SuperCoreDataStack.setup(.inMemoryStore)

or something like the following.

 //let sharedURLForAppGroup = NSFileManager.defaultManager().containerURLForSecurityApplicationGroupIdentifier("com.someidentifier")

let sharedURLForCloud =      NSFileManager.defaultManager().URLForUbiquityContainerIdentifier("com.someidentifier")

SuperCoreDataStack.setup(.persistentStore, sharedURLForAppGroup)

which gives the user much more flexibility.

This will also make the stack: property in all related calls purely optional and an override of this setting.

I will begin this part of the work today.

The threading model i'll open a separate issue for as I have some ideas which i'd like to share and get commentary back on.

michaelarmstrong avatar Mar 13 '15 15:03 michaelarmstrong

Add a delegate to handle error saving context.

PGLongo avatar Mar 19 '15 07:03 PGLongo