Originally created by @Piranit on GitHub (Jan 4, 2019).
Point model have field @NSManaged public var captured: Date
when I try let points: [Point] = CoreStore.fetchAll(From<Point>()) // get all points
points array have many points fetched from database let point = CoreStore.fetchOne(From<Point>().where(\.captured == points[0].captured))
I receive nil
but why?
how correctly get record by date?
pls, help me
Originally created by @Piranit on GitHub (Jan 4, 2019).
Point model have field
**_@NSManaged public var captured: Date_**
when I try
`let points: [Point] = CoreStore.fetchAll(From<Point>()) // get all points`
points array have many points fetched from database
`let point = CoreStore.fetchOne(From<Point>().where(\.captured == points[0].captured))`
I receive nil
but why?
how correctly get record by date?
pls, help me
Are you sure CoreStore.fetchOne(_:) is being called afterCoreStore.perform(synchronous:)?
Have you tried to use CoreStore.fetchAll(_:) instead to see if the Point is in the database at all?
@JohnEstropia commented on GitHub (Jan 15, 2019):
Are you sure `CoreStore.fetchOne(_:)` is being called _after_ `CoreStore.perform(synchronous:)`?
Have you tried to use `CoreStore.fetchAll(_:)` instead to see if the `Point` is in the database at all?
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @Piranit on GitHub (Jan 4, 2019).
Point model have field
@NSManaged public var captured: Date
when I try
let points: [Point] = CoreStore.fetchAll(From<Point>()) // get all pointspoints array have many points fetched from database
let point = CoreStore.fetchOne(From<Point>().where(\.captured == points[0].captured))I receive nil
but why?
how correctly get record by date?
pls, help me
@JohnEstropia commented on GitHub (Jan 8, 2019):
How are you saving your
Pointinstances?@Piranit commented on GitHub (Jan 8, 2019):
@JohnEstropia
@JohnEstropia commented on GitHub (Jan 15, 2019):
Are you sure
CoreStore.fetchOne(_:)is being called afterCoreStore.perform(synchronous:)?Have you tried to use
CoreStore.fetchAll(_:)instead to see if thePointis in the database at all?