Post

Replies

Boosts

Views

Activity

error: the replacement path doesn't exist:
I'm using SwiftData with an @Model and am also using an @ModelActor. I've fixed all concurrency issues and have migrated to Swift 6. I am getting a console error that I do not understand how to clear. I get this error in Swift 6 and Swift 5. I do not experience any issue with the app. It seems to be working well. But I want to try to get all issues taken care of. I am using the latest Xcode beta. error: the replacement path doesn't exist: "/var/folders/1q/6jw9d6mn0gx1znh1n19z2v9r0000gp/T/swift-generated-sources/@_swiftmacro_17MyAppName14MyModelC4type18_PersistedPr> opertyfMa.swift"
20
8
3.7k
Aug ’24
modelContext.fetchIdentifiers(descriptor) Errors when Using a SortDescriptor
modelContext.fetchIdentifiers(descriptor) errors when using a SortDescriptor to sort by a variable and returns no models. The fetch works fine without a SortDescriptor, thus FetchDescriptor<MyModel>() works fine, but FetchDescriptor<MyModel>(sortBy: [.init(\.title)]) or FetchDescriptor<MyModel>(sortBy: [SortDescriptor(\.title)]) errors with console message The operation couldn’t be completed. (SwiftData.SwiftDataError error 1.) I am using Xcode Version 16.0 beta 6 (16A5230g).
1
0
358
Aug ’24
Swift 6, SwiftData modelContext.save() Crashes, Does not AutoSave
I took one of my apps and have gone through the process of making it compatible with Swift 6. I started with Swift 5 and Complete Concurrency Checking and eliminated every warning. I flipped the switch to Swift 6 and I have no compile errors and no warnings. I also created a ModelActor and created async functions to fetch, delete, get an object's persistentID and save model objects. My SwiftData model has a notes property and the user can update or add onto the notes and resave the model object. The app crashes when I save the changes using an explicit save operation. However, the next time the app is launched, the changes did propagate. If I do not use the explicit save operation, the system does not auto-save and does not crash. When I switched back to Swift 5 and tried it out, I was able to save without a crash. I did need to use an explicit save operation though. However, I am now getting 3 warnings like the following. Type 'ReferenceWritableKeyPath<MyModel, Optional>' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode The line of code that produced that warning is `let fetchDescriptor = FetchDescriptor(sortBy: [SortDescriptor(\MyModel.title)]) However, when I flip the switch back to Swift 6, the three warnings go away and I have zero warnings under Swift 6.
5
0
669
Aug ’24
Main actor-isolated instance method 'locationManagerDidChangeAuthorization' cannot be used to satisfy nonisolated protocol requirement
I'm going through the migration to Swift 6 and I am running up with a few things. I have two view controllers which conform to the CLLocationManagerDelegate protocol. Both methods of the delegate have the same issue in my code. Below is an example of the warning received. Main actor-isolated instance method 'locationManagerDidChangeAuthorization' cannot be used to satisfy nonisolated protocol requirement; this is an error in the Swift 6 language mode
4
0
2k
Jul ’24
Text Above List w/ VStack Appears as View's Title
I am curious about the fact that the Text above the VStack is shown as a title to the view. I didn't know one could place Text above a VStack without another VStack. Here's the partial code showing the situation. @State private var results = [Result]() var body: some View { Text("Songs of Al Di Meola on iTunes") .font(.title3) .fontWeight(.bold) List(results, id: \.trackId) { item in VStack(alignment: .leading) { Text(item.trackName) .font(.headline) Text(item.collectionName) } } .task { await loadData() } } See picture for details.
0
0
293
Jul ’24
Please Create a Sendable Version of CKRecord or Make CKRecord Sendable
CKRecord is a class which does not conform to the Sendable protocol. Its fields consist of NSStrings, NSData and others which are not Sendable. I understand that Apple is incrementally modifying objects to be sendable, but I am experiencing and I would assume others are experiencing a very large number of warnings (for now) about CKRecords and Sendable. It may be too much to make CKRecord Sendable and it may be too much to create a Sendable version of CKRecord, but it would be nice if it could at least be investigated. My particular situation is I have created a Protocol named CKMethods which some of my view controllers use to download and upload CKRecords. I suddenly have a large number of warnings about non-sendable types being sent from main actor-isolated context to non-isolated instance method. The CKRecords sent to and from the protocol do not get mutated and I have never had a problem with data races in the years that I have had this protocol. At some point, the warnings will probably become errors and I definitely do not want to get to that point. I am still coming up to speed on Swift Concurrency, so there may be a more simple solution than the one I am working on - creating a Sendable Struct for every CKRecord type that I have in my app and modifying all of the methods to pass the Struct instead of a CKRecord and convert the Struct to a CKRecord for upload and convert the CKRecord to the Struct for download.
3
1
1.5k
Apr ’23
Could Not Launch Mac (Designed for iPad) App in Xcode
I get the following message when I try to run this app in Xcode. Could not launch AppName. Runningboard has returned error 5. Please check the system logs for the underlying cause of the error. Interestingly, the destination Mac (Mac Catalyst) destination does launch. The funny thing is there is a companion app almost exactly like this one that launches fine. Any help with this would be greatly appreciated. Xcode helped me to file a feedback. The number is FB13206919.
8
1
3.2k
Sep ’23
visionOS Build Issues
I've been working on a visionOS platform for my existing app. I added the visionOS platform in App Store Connect. In Xcode 15.2, I set the destination to 'Any visionOS Device (Designed for iPad, arm64)'. The App Store Connect visionOS platform does not see the build. It does show up as an iOS build on Test Flight. I don't see anyway to designate the build as a build that the visionOS destination sees. Also, the upload failed when I tried to set the version for the app as 1.0. It went through when I put the version as a number higher than my iOS app version.
2
0
756
Jan ’24
About Adding a visionOS Platform and Uploading a visionOS Binary
I have modified two of my apps to run on visionOS and I see that in App Store Connect, one add a visionOS Platform. My question is, why would I want to do this if I can't upload a visionOS binary? Would it be to work on the metadata? Also, I would like to have my visionOS binary evaluated. Is there any way to do this at this time? It appears that only iOS or iPadOS apps are being evaluated.
1
0
603
Nov ’23