How to solve fatal Xcode Runtime Error

Hey there,

My application crashes every time I try to tap one of my buttons on my phone. In the debug session I ran earlier on my app to root out the issue, it gave me an "EXC-BAD-ACCESS" error and had "(lldb)" in the Console. I've tried turning on Zombie Objects and re-writing the lines of code but nothing seems to work.

I know this is a memory-based error, but how do I fix it?

The code is:
Code Block Swift
Button(action: {self.reportView.toggle()}) {
          HStack {
            Text("Report an Error")
            Image(systemName: "exclamationmark.bubble.fill")
          }
          .padding(.all, 10)
          .background(Color.red)
          .cornerRadius(10)
          .foregroundColor(.white)
        }.sheet(isPresented: $reportView) {
          ReportView()
        }

All the variables work.

I think it's pretty ironic that the Error button is the one that doesn't seem to co-operate! 😂

The odd thing is though, every other button in my app works, but this one does not. The view layouts are pretty much identical apart from the content. Navigation Bar Title > Subtitle > Content.

Thanks for your time,

Grey360
How to solve fatal Xcode Runtime Error
 
 
Q