Post

Replies

Boosts

Views

Activity

Reply to Swift 6 Concurrency errors with ModelActor, or Core Data actors
Thanks for the clarification. Does Apple have any documentation/examples for best practices or patterns when working with SwiftData and concurrency? From the searches and documentation I read, guess I was misled that you should use ModelActors as background interfaces to your models. I’ve seen a lot of examples like the one below: @ModeActor actor ItemActor {     func create() async     func fetch()     func importData() async } Because of that I’ve created actors like ImportService, ExportService, SearchService, AttachmentService, etc, but now I can’t use them with each other. I guess this is not how you are supposed to use them. My app has a lot of heavy relationships that are set using asynchronous dependencies, so ModelActors made everything much easier. Originally I was constantly returning object ids then refetching them from context.perform in CoreData, which never seemed right either.
Mar ’25
Reply to Unable to sync Swift Data with iCloud
I'm also having the the exact same issue and get the Server Rejected error while trying to follow Apple's documentation: https://developer.apple.com/documentation/swiftdata/syncing-model-data-across-a-persons-devices Environment: Xcode 16.1 on MacOS 15.1. Attempted solutions: I've tried specifying the exact container in the setup: ModelConfiguration(schema: schema, isStoredInMemoryOnly: false, cloudKitDatabase: .private("iCloud.com.MyCompany.MyApp")) Tried reseting the container environment. Signed out/in of iCloud and restarted computer. Made sure iCloud storage isn't full. Added the CloudKit framework manually to the target. Initialized schema manually as shown in the documentation (this causes a crash with the same error). Tried removing the CloudKit permission from the Certificates, Identifiers & Profiles in my developer account then re-adding it. None of that has worked, and the CloudKit dashboard doesn't show that any schema was created. Error: CoreData: error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _recoverFromError:withZoneIDs:forStore:inMonitor:](2620): <NSCloudKitMirroringDelegate: 0x600000938000> - Failed to recover from error: CKErrorDomain:15 Recovery encountered the following error: (null):0 CoreData: CloudKit: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _finishedRequest:withResult:](3582): Finished request: <NSCloudKitMirroringDelegateSetupRequest: 0x60000152c960> 31BF786C-8AD8-48F4-A8A3-328A17A51019 with result: <NSCloudKitMirroringResult: 0x6000038c82a0> storeIdentifier: F3647739-ECCB-4106-AD56-1C4D329C954C success: 0 madeChanges: 0 error: <CKError 0x60000385fae0: "Partial Failure" (2/1011); "Failed to modify some record zones"; uuid = 517D53B7-C0E1-4EFB-AEB9-D3339C122DFE; container ID = "iCloud.com.MyCompany.MyApp"; partial errors: { com.apple.coredata.cloudkit.zone:__defaultOwner__ = <CKError 0x6000038d3150: "Server Rejected Request" (15/2000); op = A473375D93C18793; uuid = 517D53B7-C0E1-4EFB-AEB9-D3339C122DFE> }>
Nov ’24
Reply to Swift 6 Concurrency errors with ModelActor, or Core Data actors
Thanks for the clarification. Does Apple have any documentation/examples for best practices or patterns when working with SwiftData and concurrency? From the searches and documentation I read, guess I was misled that you should use ModelActors as background interfaces to your models. I’ve seen a lot of examples like the one below: @ModeActor actor ItemActor {     func create() async     func fetch()     func importData() async } Because of that I’ve created actors like ImportService, ExportService, SearchService, AttachmentService, etc, but now I can’t use them with each other. I guess this is not how you are supposed to use them. My app has a lot of heavy relationships that are set using asynchronous dependencies, so ModelActors made everything much easier. Originally I was constantly returning object ids then refetching them from context.perform in CoreData, which never seemed right either.
Replies
Boosts
Views
Activity
Mar ’25
Reply to Swift 6 Concurrency errors with ModelActor, or Core Data actors
Thanks! Unfortunately, the service makes so many different changes to items and their relationships that would be difficult to undo. Another reason I can't save changes is that if the master service fails halfway though it could cause data corruption, which is why it only commits changes after it completes.
Replies
Boosts
Views
Activity
Mar ’25
Reply to Unable to sync Swift Data with iCloud
Can you try changing the CloudKit container to a completely different one? I did this and suddenly it started working.
Replies
Boosts
Views
Activity
Nov ’24
Reply to Unable to sync Swift Data with iCloud
I'm also having the the exact same issue and get the Server Rejected error while trying to follow Apple's documentation: https://developer.apple.com/documentation/swiftdata/syncing-model-data-across-a-persons-devices Environment: Xcode 16.1 on MacOS 15.1. Attempted solutions: I've tried specifying the exact container in the setup: ModelConfiguration(schema: schema, isStoredInMemoryOnly: false, cloudKitDatabase: .private("iCloud.com.MyCompany.MyApp")) Tried reseting the container environment. Signed out/in of iCloud and restarted computer. Made sure iCloud storage isn't full. Added the CloudKit framework manually to the target. Initialized schema manually as shown in the documentation (this causes a crash with the same error). Tried removing the CloudKit permission from the Certificates, Identifiers & Profiles in my developer account then re-adding it. None of that has worked, and the CloudKit dashboard doesn't show that any schema was created. Error: CoreData: error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _recoverFromError:withZoneIDs:forStore:inMonitor:](2620): <NSCloudKitMirroringDelegate: 0x600000938000> - Failed to recover from error: CKErrorDomain:15 Recovery encountered the following error: (null):0 CoreData: CloudKit: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _finishedRequest:withResult:](3582): Finished request: <NSCloudKitMirroringDelegateSetupRequest: 0x60000152c960> 31BF786C-8AD8-48F4-A8A3-328A17A51019 with result: <NSCloudKitMirroringResult: 0x6000038c82a0> storeIdentifier: F3647739-ECCB-4106-AD56-1C4D329C954C success: 0 madeChanges: 0 error: <CKError 0x60000385fae0: "Partial Failure" (2/1011); "Failed to modify some record zones"; uuid = 517D53B7-C0E1-4EFB-AEB9-D3339C122DFE; container ID = "iCloud.com.MyCompany.MyApp"; partial errors: { com.apple.coredata.cloudkit.zone:__defaultOwner__ = <CKError 0x6000038d3150: "Server Rejected Request" (15/2000); op = A473375D93C18793; uuid = 517D53B7-C0E1-4EFB-AEB9-D3339C122DFE> }>
Replies
Boosts
Views
Activity
Nov ’24
Reply to 'Automatically Show Web Inspector for JSContexts' doesn't work
I'm also interested in figuring out how to do this. Our app uses a lot of WebViews, so having to manually open it every time we rebuild the app is very time consuming.
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Different price tier for MacOS version of iOS app
I'm also wondering if this is possible. I'd like my iOS app to be free, while the Mac app stays paid.
Replies
Boosts
Views
Activity
Dec ’21