I have a strange problem in a Core Data application.
I have three objects in my application, but today I found a problem with one of them. My problematic entity is called Invoiceand has many attributes, including Products. It encoded an NSArray from NSDictionaries (default is NSValueTransformer).
Everything works fine - I create my account, his client, his products, etc. Everything is working.
But , when I select my account from the list, and then try to edit its products and click the "Save" button, my save only works until my application is complete.
The problem is only in my array Products- the rest (for example, payment date, customer, etc.) are saved.
What am I doing
I pass my Invoiceobject through
NSManagedObject *inv = [self.fetchedResultsController objectAtIndexPath:indexPath];
invoiceEditor.invoice = inv;
And save my data (in my InvoiceEditorVC):
[self.invoice setValue:client forKey:@"Client"]
[self.invoice setValue:products forKey:@"Products"]
[self.invoice setValue:pmDate forKey:@"PaymentDate"]
NSManagedObjectContext *context = self.invoice.managedObjectContext;
NSError *error = nil;
if (![context save:&error]) {
NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
abort();
}
All things are saved until completion: customer, products, dates. But only the products "reboot" after completion.
Is anyone