|
I recently tried converting my app from just using CoreData to also use CloudKit so that a user would be able to use another device under the same account to work with items. I followed this video: https://youtu.be/TsfOYHbf4Ew to do this. While added and deleted items are reflected, when I update some part of the entitiy, for instance a Bool attribute is changes from false to true, it is not reflected in the CloudKit container, and therefore the other device. I've tried to utilize other resources to rectify this, without success. .....and now I'm lost... I don't really understand how or why this is happening. I'm trying to not make this the longest post ever so my examples are just portions of the code... here is part of the class that does all my container setup and updating:
I'm not sure what else to show, but am using this app to learn SwiftUI, so am open to help, critiques, or just down right shame. Please, help me learn and get better. Thank you |
|
hi, since adding and deleting items are working, you must have the basic set-up running correctly. thus, a quick question: when you toggled the boolean value, did you call ... asking for a friend, DMG |
|
@delawaremathguy, great question, and I belive I do. I guess if would have been smart to include that before, but I was trying not to write a book here. Here is the relevant code:
|
|
hi Luke, sorry, but i don't have an immediate answer here for you, but i would look at a few things.
this is not the most specific information i've given, but perhaps it will still help. DMG |
|
I have been able to monitor device 1, and do see the cloudkit pushes happening, but they don't appear to be taking in the cloudkit container. when I got there I don't see the bool values updated. I haven't checked device 2 because I had thought I identified where the problem was, between 1 and cloudkit, but I'm jut kind of lost as to why. admittedly, I should probably do this all again, and really dig into each log. also, i tried removing from both for a clean sweep as you suggested, but nothing changed. I'll go back and look at the logs more closely. Thanks for you help and advice along the way. |
|
How do you install the apps? Via Xcode or via TestFlight. If you want to sync them on several devices via TestFlight you have to deploy the schema to production. It's also possible you made changes to the data model and forget to deploy the changes to production. Apple Watch doesn't sync without TestFlight at all. |
|
ok, I've found a pretty good work around. I've made "loan" it's own entity now. and it's updating perfectly... i do appreciate the advice from everyone however. to follow up on the last questions: i had the schema deployed to production. and both devices were getting their image from testflight working now! |
SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.