David Bureš on Nostr: Hey guys, a quick question about SwiftData. I have two models, SavedTrip and ...
Hey guys, a quick question about SwiftData.
I have two models, SavedTrip and SavedPlace. I’m trying to create a relationship between them, in which SavedTrip contains an optional array of SavedPlaces. However, I’m getting a crash when a SavedTrip has no SavedPlaces (this should be possible, since I marked SavedPlace as optional).
What am I doing wrong?
I’d appreciate any help. I’ll just be going to sleep now, since it’s 1AM here, so I’ll look at the responses tomorrow.
Thanks!
I have two models, SavedTrip and SavedPlace. I’m trying to create a relationship between them, in which SavedTrip contains an optional array of SavedPlaces. However, I’m getting a crash when a SavedTrip has no SavedPlaces (this should be possible, since I marked SavedPlace as optional).
What am I doing wrong?
I’d appreciate any help. I’ll just be going to sleep now, since it’s 1AM here, so I’ll look at the responses tomorrow.
Thanks!