Relative Content

Tag Archive for swiftswift-data

Swiftdata get-error (Thread 6: EXC_BREAKPOINT (code=1, subcode=0x1cc165d0c)) -issues when inserting a new swiftdata

When I do the classic modelcontext.insert(myModel) everything works fine. But since I want at the same time initialize a local notification using myModels UUID as the identifier the app crashes. Now, I tried out not initializing the notification directly, just reading the UUID.uuidstring when viewing the newly inserted myModel. But it cannot fetch the UUID (the variable is called objectID in my case), it only crashes. Why?

Multiple Models Swiftdata

I have multiple Models but don’t know how to tell that SwiftData.
My current Code looks like this: