Open kexoth opened 11 years ago
Hey man, how are you? First of all, your question is really good.
Do to things without coupling the framework with the coredata objects I let you customize how objects are created using blocks.
Try to look at this class: https://github.com/dchohfi/KeyValueObjectMapping/blob/master/KeyValueObjectMapping/DCCustomInitialize.h
and see if you understand how to use the blocks to create your objects, then inside that block you create using the normal NSEntityDescription from coredata.
If your question persist, please let me know and I try to write some code to you.
Cya man
Hi dchohfi
I am having same issue as kex's.. Could please give small snippet of example for using block and initialising object as NSManagedObject.?
Thanks, Xrnd
For me this worked: DCCustomInitialize _selfInitializer = [[DCCustomInitialize alloc] initWithBlockInitialize:^id(weak Class classOfObjectToGenerate, NSDictionary *weak values, __weak id parentObject) { // init your core data object and return it NSManagedObject temporaryObject = [[NSManagedObject alloc] initWithEntity:description insertIntoManagedObjectContext:nil]; return temporaryObject; } forClass:_class of your core data object];
Hey,
In your podspec is written that you support work with CoreData, but in practice I cannot find it in the documentation, nor the tests.
Could you provide a simple example how's that supposed to work?
I thought it would work out of the box, but this is what happens:
in this line I get
CoreData: error: Failed to call designated initializer on NSManagedObject class 'MyNSManagedObjectSubclass'
.I know that this in CoreData should look something like:
.. but I don't know how to populate all the properties in my NSManagedObject with your library.
Thanks,
Kex