From the looks of it, I need to implement the following. Apple don't have the facility for the items below.
use the Logger api for logging and writing to the system log
use OSLogStore on a separate thread to write to disk in my app space
collect the log and analyze the performance issue
Post
Replies
Boosts
Views
Activity
ops, no, I'm not interested in the deviceActivity framework. Looks like I can't remove tags neither.
I want to use the Logger/OSLog framework to write logs to disk. So that I can understand the performance issue with the app.
let id = model.persistentModelID
let descriptor = FetchDescriptor<cache>(
predicate: #Predicate { $0.cacheOf.persistentModelID == id }
// predicate: #Predicate { $0.cacheOf.id == id } or this
)
let result = (try? self.modelContext.fetch(descriptor) // 💥 crash here!
.first)
return result
Some update on this! So turns out, I was fetching a model that was just created. The system can't find the model. I guess this was a cache miss in swiftData?!
To Fix This: In your modelActor try? self.modelContext.save()
basically, you want the modelContext to write into disk to create the persistentModelID
Good luck!
turns out setting data on the Observable's property NEEDS to happen in a closure scheduled in to an actor. Otherwise it crashes
swiftData is very busted on iOS 18. It broke all of my preview with swiftData. Somehow persistentModelID no longer works, too
Turns out, I added an share extension with a new bundle id. The new id needs manually registered :|
The xcode cloud error might or may not be related to solving my error code 70. The export and distribute is the way to debug.
Turns out, once I get the token from appleID. I can directly send it into subSystem A and subSystem B and it worked just fine.
It seems to crash with any SwiftData related id, but it's fine when just using the primitive values
let id = model.persistentModelID
let descriptor = FetchDescriptor<cache>(
predicate: #Predicate { $0.cacheOf.persistentModelID == id }
// predicate: #Predicate { $0.cacheOf.id == id } or this
)
let result = (try? self.modelContext.fetch(descriptor) // 💥 crash here!
.first)
return result
@Environment(\.scenePhase) private var phase
Does this API needs some special requirement? no changes ever comes from this.
The SwiftUI view sits in a UIHostingViewController. None of the events are coming through.
Any update on this one???
Any update to this? would be interested in getting a hardware dock to work with the accessory manager
I second this one! There are so many app ideas for this.