Why Nostr? What is Njump?
2023-07-05 23:15:59

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!



Author Public Key
npub1zl99ghn2xqnyffuf3hrgvtj39wuc0jqtz0g8hul4cfzgufxmnd0slddnmj