We got a segmentation fault on our Testflight build (not on debug builds). The build was created with the latest xCode version, the code is written in Swift (SwiftUI).
Luckily, one developer still uses an older version of xCode (12.4) and realised that the code doesn't compile for that version. We get a "Variable ... used before being initialized" compiler error.
Turns out that fixing the compiler error also fixes the segmentation fault crash.
@Binding var playingId: Int?
@State var player: AVPlayer
init(playingId: Binding<Int?>,) {
self.player = AVPlayer()
self._playingId = playingId
}
changed to:
@Binding var playingId: Int?
@State var player: AVPlayer = AVPlayer()
init(playingId: Binding<Int?>,) {
self._playingId = playingId
}
So, I wonder where the problem lies:
Is this a compiler bug in the newest version?
A runtime problem?
Or a problem in the language definition?
Selecting any option will automatically load the page