mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-12 04:10:36 +01:00
The fetched object at index 2 has an out of order section name 'Txt. #354
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 @jerryga on GitHub (Dec 22, 2020).
Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=NSCocoaErrorDomain Code=134060 "A Core Data error occurred." UserInfo={reason=The fetched object at index 2 has an out of order section name 'Txt. Objects must be sorted by section name'}: file CoreStore/ListPublisher.swift, line 387

@jerryga commented on GitHub (Dec 22, 2020):
@Field.Virtual(
"typeGroup",
customGetter: { object, field in
@jerryga commented on GitHub (Dec 22, 2020):
static let ScanPublisher: ListPublisher = iScanCoreData.dataStack.publishList(
From()
.sectionBy(.$typeGroup)
.orderBy(.ascending(.$date))
@JohnEstropia commented on GitHub (Dec 22, 2020):
@jerryga The error is telling you what's missing:
Objects must be sorted by section nameYou specified
typeGroupas your section grouping, but you are ordering them bydate. This means the objects with similartypeGroups would not be ordered in a way that they'll appear in the same section. Your firstorderByclause should always be relevant for yoursectionBy:@jerryga commented on GitHub (Dec 22, 2020):
@JohnEstropia Thank you very much! You save me time.