it's a good idea. I'll try it.
Post
Replies
Boosts
Views
Activity
I've synced the device's data to iCloud but my issue is more like asynchronous cumulative number problem. We knew the result would be wrong.
We know that to get the right answer that need to change from asynchronous to synchronous. I think of putting scripts on the CloudKit. But the server does not seem to support such an operation.
Thanks for discussed the issue.
I will try to describe this problem in more detail.
The Self is custom class 'Managed', It's a subclass of NSManagedObject.
and I made some changes to delete ‘configurationBlock(request)’.
so the new code:
public static func fetch(in context: NSManagedObjectContext,
configurationBlock: (NSFetchRequest<Self>) -> () = { _ in } ) -> [Self] {
let request = NSFetchRequest<Self>(entityName: Self.entityName)
return try! context.fetch(request)
}
it become a simplest CoreData query code.
I have called this function dozens of times and the problem with it occurs again and I still use the lldb of Xcode that input 'po context.fetch(request)'.
error: :8:15: error: cannot convert value of type 'NSFetchRequest' to expected argument type 'NSFetchRequest'
context.fetch(request)
^
:8:15: note: arguments to generic parameter 'ResultType' ('ResultType' and 'any NSFetchRequestResult') are expected to be equal
context.fetch(request)
^
I call this method many times in the same way that it successful. I confuse why did it fail.
when I use detach command and I get this:
error report
This error does not occur on every call。
Let the lldb of Xcode that input 'po context.fetch(request)'. and I get the messages:
error: :8:15: error: cannot convert value of type 'NSFetchRequest' to expected argument type 'NSFetchRequest'
context.fetch(request)
^
:8:15: note: arguments to generic parameter 'ResultType' ('ResultType' and 'any NSFetchRequestResult') are expected to be equal