mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-11 20:00:30 +01:00
Tricky issue #272
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @TeddyDreyfus on GitHub (May 7, 2019).
Hi John,
I have the following question if you can help me. The
employeeproperty that is being set below cause me issue:The issue I get is:
[CoreStore: Error] NSManagedObjectContext+Transaction.swift:203 saveAsynchronouslyWithCompletion
↪︎ Failed to save 'NSManagedObjectContext'.
(CoreStore.CoreStoreError) .internalError (
.errorDomain = "com.corestore.error";
.errorCode = 5;
.NSError = (
.domain = "NSCocoaErrorDomain";
.code = 1560;
.userInfo = 1 key-value(s) [
"NSDetailedErrors" = (
"Error Domain=NSCocoaErrorDomain Code=1570 "The operation couldn\U2019t be completed. (Cocoa error 1570.)" UserInfo={NSValidationErrorObject=<Employee: 0x600002cb2b20>
I'm not sure what leads to this issue. I have a ListMonitor that populates a table view. My understanding is that once the notes are imported, then the ListMonitor will make them available on main thread and my table view will be populated, etc.
No need to use fetchExisting() to pass instances back to the main thread when using a ListMonitor, correct?
If I comment the
employeeproperty that is being set, I do not have the above issue.Note: this same employee instance is also set as a property inside a singleton class instance (at app launch, before this Note importation is being done). So I suspect the issue to be somehow related to that, but cannot understand why?
Thanks a lot for this great project and your time.
Teddy
@TeddyDreyfus commented on GitHub (May 8, 2019):
I just realized what was wrong in my code. Due to bad mapping in update() method, I was overriding and setting to nil a property, configured with a default value and not optional. The property being nil was leading to this issue upon insert. All good!