我尝试使用新的SwiftUI框架创建一个应用,并且在预览和模拟器中都能正常工作。但是,当我连接iPhone(XR)或iPad(第六代)(均运行iOS 13 beta 2)时,该应用仅显示白色或黑色屏幕(取决于打开或关闭的暗模式)。
Xcode说'EXC_BAD_ACCESS',所以我用Google搜索了一下,我已经尝试使用Zombie对象。没有成功
struct ContentView : View {
var body: some View {
NavigationView {
List(pindata) { pin in
NavigationButton(destination: PinDetail(pin: pin, amount: UserDefaults.standard.integer(forKey: pin.color))) {
PinRow(pin: pin)
}
}.navigationBarTitle(Text("Pins"))
}
}
}
该代码段的第8行出现错误“ EXC_BAD_ACCESS”。
我希望该应用程序能够像在模拟器中一样运行,但是我在控制台中收到此错误:
2019-06-19 17:32:59.083958+0200 Pins[894:85155] [Assert] COMPATIBILITY BUG IN CLIENT OF UIKIT: Moving method canvasToolbar from UICanvas to UIWindowScene 2019-06-19 17:32:59.084270+0200 Pins[894:85155] [Assert] Registering Canvas Component Class _UICanvasUserActivityManager, please update to Frame Components 2019-06-19 17:32:59.089296+0200 Pins[894:85155] [Assert] Calling deprecated SPI on UICanvas. This method and class will dissapear prior to GM 2019-06-19 17:32:59.091533+0200 Pins[894:85155] [TraitCollection] Class _UISheetPresentationController overrides the -traitCollection getter, which is not supported. If you're trying to override traits, you must use the appropriate API. 2019-06-19 17:32:59.091575+0200 Pins[894:85155] [TraitCollection] Class _UIRootPresentationController overrides the -traitCollection getter, which is not supported. If you're trying to override traits, you must use the appropriate API. 2019-06-19 17:32:59.103592+0200 Pins[894:85155] [TraitCollection] Class UIPopoverPresentationController overrides the -traitCollection getter, which is not supported. If you're trying to override traits, you must use the appropriate API. (lldb)