我在调试模式下没有得到这一点,但当我将运行模式切换到释放模式时,我的电话在以下线路上崩溃:
self.podcasts = PodcastsView(play: { audio in
self.videoPlayerView.pause()
self.showVideoPlayer = false
self.audioPlayerView.play(audio: audio)
self.audioCurrentlyPlaying = audio
self.showAudioPlayer = true
self.playBarShowing = true
}, indentBottom: Binding(get: {
self.playBarShowing
}, set: {
self.playBarShowing = $0
}))错误:Thread 1: EXC_BAD_ACCESS (code=1, address=0xfffffffffffffff0)
这是被调用的初始化器:
init(play: @escaping (_ audio: KHKAudio) -> Void, indentBottom: Binding<Bool>) {
self.play = play
self.model = PodcastsViewModel()
self.indentBottom = indentBottom
}发布于 2021-08-20 19:39:20
我想通了。在被调用的初始值设定项中,“@ObservedObject”是一个模型,而不是一个@StateObject。改变这一点可以修复它。我不明白为什么,但是,为什么这只是一个发布问题。
https://stackoverflow.com/questions/68867123
复制相似问题