Post

Replies

Boosts

Views

Activity

Reply to SwiftData ModelContext Fetch Crashing
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
Sep ’24
Reply to SwiftData ModelContext Fetch Crashing
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!
Nov ’24
Reply to Motorized dock hardware for DockKit?
Any update to this? would be interested in getting a hardware dock to work with the accessory manager
Topic: App & System Services SubTopic: Hardware Tags:
Replies
Boosts
Views
Activity
Sep ’23
Reply to Using SwiftData in background?
Any update on this one???
Replies
Boosts
Views
Activity
Jan ’24
Reply to Detect foreground/background change
@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.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jul ’24
Reply to SwiftData ModelContext Fetch Crashing
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
Replies
Boosts
Views
Activity
Sep ’24
Reply to Using AppleId appleIdToken in two different sub-systems
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.
Topic: Privacy & Security SubTopic: General Tags:
Replies
Boosts
Views
Activity
Oct ’24
Reply to Xcodecloud Xcodebuild Failed With Exit Code 70
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.
Replies
Boosts
Views
Activity
Oct ’24
Reply to SwiftData crash on fetch
swiftData is very busted on iOS 18. It broke all of my preview with swiftData. Somehow persistentModelID no longer works, too
Replies
Boosts
Views
Activity
Oct ’24
Reply to Do update to @Observable properties have to be done on the main thread?
turns out setting data on the Observable's property NEEDS to happen in a closure scheduled in to an actor. Otherwise it crashes
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’24
Reply to SwiftData ModelContext Fetch Crashing
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!
Replies
Boosts
Views
Activity
Nov ’24
Reply to Persist OSLog in "Analytics & Improvements"
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.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Dec ’24
Reply to Persist OSLog in "Analytics & Improvements"
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
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Dec ’24
Reply to Location streaming onto Live Activity
yes, my app is a workout app. The workout session link didn't work for me. Could you paste the URL as txt?
Replies
Boosts
Views
Activity
Jun ’25
Reply to Importing Data into SwiftData in the Background Using ModelActor and @Query
IS this fixed? I'm still experiencing this in 18.4 GM version of the iOS OS
Replies
Boosts
Views
Activity
Jun ’25
Reply to Apple Developer Program complain expired card, but it's NOT!
some update on this. turns out. This update doesn't work on apple web, this only works on iOS/iPadOS operation system. I was able to update only on my test phone.
Replies
Boosts
Views
Activity
Jul ’25
Reply to MapKit Not Updating MapContentBuilder after each mapCameraKeyframeAnimator keyframe
For some reason I can't extract the issue into a sample project. Thank you for your reply, I will regroup.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’25