nalexn / ViewInspector

Runtime introspection and unit testing of SwiftUI views
MIT License
2.16k stars 148 forks source link

Thread 1: EXC_BAD_ACCESS (code=1, address=0x0) #243

Closed yuntan closed 1 year ago

yuntan commented 1 year ago
let view = ContentView()
try view.inspect().vStack() // -> crash

Thread 1: EXC_BAD_ACCESS (code=1, address=0x6) happens at Inspector.swift line 93. version 0.9.5.

スクリーンショット 2023-05-05 16 25 20

minimal ContentView:

struct ContentView: View {
    let tag = ContentView.self

    var body: some View {
        VStack {
            Image(systemName: "globe")
                .imageScale(.large)
                .foregroundColor(.accentColor)
            Text("Hello, world!")
        }
        .padding()
    }
}

let tag = ContentView.self is cause of this problem.

nalexn commented 1 year ago

Please provide a minimal code with which the issue can be reproduced; just two lines aren't helpful

yuntan commented 1 year ago

@nalexn updated.

nalexn commented 1 year ago

Released in v0.9.8