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