mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-11 20:00:30 +01:00
Using Where clause always results in empty or nil
#392
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 @iarata on GitHub (Sep 10, 2022).
In my app, I have the following
CoreStoreObjectclass which I use to store assignments:I can successfully create
AssignmnetCoreobjects and store them using the following method:But every time that I try to use the
Whereclause to get a specific object usingfetchAllorfetchOneit returns nil or empty. Also, thedeleteAllis not deleting the object and I'm using theWherejust like below.This has been happening recently and it was working fine even before I change to develop branch.
I tried the following ways but all resulted in empty data (the data exists because if I just use
fetchAllI get all the objects):In addition, every time I try to use the
==operator in the where clause I getOperator function '==' requires that 'AssignmentCore' inherit from 'NSManagedObject'error.The example below results in the above error:
Running on iOS 15.0
Using CoreStore develop branch
Xcode 14.0 (14A309)
@JohnEstropia commented on GitHub (Sep 10, 2022):
Since you are using the
@Fieldproperty wrappers, use this syntax when querying:@iarata commented on GitHub (Sep 10, 2022):
I think I missed that note in the docs.
Thank you it works now 🎉