I have a Track and Album entities, where track has optional to-one .album relationship.
@Model class Track: NSManagedObject, Decodable {
@Relationship(inverse: \Album.tracks)
var album: Album?
}
@Model class Album: NSManagedObject, Decodable {
var tracks: Set<Track> = []
}
When I try to assign a value to this album property, I get very strange crash that [Album count] is "unrecognized selector sent to instance". But don't see what could possibly be calling count.
Here's some screenshot of stack frames from the moment exception happens (it's different threads because this is from different attempts - each attempt gives identical frame stack):
Do you have any idea if this could be something in the PersistentModel implementation..?