Post

Replies

Boosts

Views

Activity

Reply to Why is CKModifyRecordsOperation to batch delete records in CloudKit not deleting records?
When the delete button is clicked, it invokes the deleteRecord() method, as defined in the preceding code. Subsequently, the system outputs the message "successful delete deleteRecordIDS = ...," (The deleteRecordIDs is not empty.) Finally, I refreshed the CloudKit dashboard and clicked the Query Records button on the web interface; however, the deleted CKRecord still appears to exist. When I reinstalled the app, The record was downloaded again. I would like to upload the minimal Xcode test project, but I am currently unsure of the procedure.
2w
Reply to EXC_BAD_INSTRUCTION
I seem to have found the wrong way to trigger, in my original code I used the Promise framework and I put the 'fetch' method into the asynchronous closure of the Promise, and when I trigger function something, The asynchronous closure of the Promise will be called several times (the closure will call back after it completes the query). Of course, with many successes, sometimes an error will be reported. I don't understand what went wrong. If you can't find a solution, please provide some ideas to help me find the problem. My project is too complicated, and a simple Demo doesn't seem to trigger this problem.
Mar ’25
Reply to Async Data with iCloud
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.
Mar ’25
Reply to EXC_BAD_INSTRUCTION
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.
Mar ’25
Reply to EXC_BAD_INSTRUCTION
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
Feb ’25