import SwiftUI
struct ContentView: View {
@State private var username: String = ""
var body: some View {
VStack {
TextField("Username", text: $username)
Text(username)
}
}
}
将其放入我的应用程序的根源中。
import SwiftUI import SwiftData @main struct K_TutorApp: App { var body: some Scene { WindowGroup { ContentView() } } }
,但是仍然丢下同样的错误!!!
我甚至在手机上卸载了该应用程序(我将手机用作模拟器),并且错误仍然存在。没有人知道我可以尝试解决这个问题 /为什么会发生此错误?
如果您有点垃圾邮件,您可能会有更多日志:
Can't find or decode reasons
Failed to get or decode unavailable reasons
Error: this application, or a library it uses, has passed an invalid numeric value (NaN, or not-a-number) to CoreGraphics API and this value is being ignored. Please fix this problem.
If you want to see the backtrace, please set CG_NUMERICS_SHOW_BACKTRACE environmental variable.
AVHapticClient.mm:446 -[AVHapticClient finish:]: ERROR: Player was not running - bailing with error Error Domain=com.apple.CoreHaptics Code=-4805 "(null)" for client 0x1000ba5
Gesture: System gesture gate timed out.
在某些时候,我明确地提到了这是一个内部错误。
,但是,该错误仅在启用调试模式时才发生。杀死您的应用程序并从应用程序图标再次运行,它应该点头发生。因此,即使在开发和测试中很烦人,我也建议忽略此问题。
发现
!