objcio / core-data

Sample code for the objc.io Core Data book
https://www.objc.io/books/core-data
MIT License
769 stars 197 forks source link

CoreData Error: Invalid generation token: this persistent store coordinator does not have any of the referenced stores #53

Open manikal opened 5 years ago

manikal commented 5 years ago

I'm getting this CoreData error in my crash reporter but I'm unable to reproduce it.

The crashing lines:

The error message:

Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=NSCocoaErrorDomain Code=134060 "A Core Data error occurred." UserInfo={Reason=Invalid generation token: this persistent store coordinator does not have any of the referenced stores}: file /BuildRoot/Library/Caches/com.apple.xbs/Sources/swiftlang_Fall2018/swiftlang_Fall2018-1000.11.42/src/swift/stdlib/public/core/ErrorType.swift, line 184

I would like to decipher error message. Does Invalid generation token refers to NSQueryGenerationToken? Is the error part of conflict resolution process?

I guess the only thing different in my implementation is that I didn't use custom merge policy but mergeByPropertyStoreTrumpMergePolicyType.