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).
Post
Replies
Boosts
Views
Activity
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"
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.
I'm getting a lot of warnings of this within my app. I'm trying to migrate to Swift 6.
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
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.
Question. Is there a way to hook up the Apple Vision Pro to the Mac for development without using the $299 dongle? I was thinking of a USB-C cable from the battery to the Mac. Someone mentioned wireless, but usually one has to connect first.
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.
I have had this issue for many many months and decided to reach out here to see if anybody else has had and fixed this problem. I can compete the purchase on the Mac. I can make a full price purchase using the Apple Card on the Apple Store App.
Is there anyway to do the following basic outline with the exception of a modal presentation? It seems like there should be some additional input that designates a modal transition. But I cannot find one.
NavigaitonStack
NavigationLink
.navigationDestination
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.
I can use the option key to bring up the two dots and I can add the shift key to move around the dots, but when I untouch the shift key, one dot moves across the map instead of the dots staying together. Is this even a feature that should work on the visionOS simulator?
Is there a way? I turned it on in the visionOS simulator, but could not find a way to turn it off.
Any info on this?
Every time I hit the 'Settings' button, it crashes. Again, Xcode 15.1 beta.