Crash with error: Thread 1: EXC_BAD_ACCESS (code=2, address=0x7fff86533e38)
Describe the bug When I was using 1.2.0 and Xcode 10.2 it was working fine. As I switched to Xcode 11.2 and 1.4.0 version of Instruction. I found a crash while assigning a delegate to CoachMarksController instance.
To Reproduce Assign a delegate to an instance of CoachMarksController. In Xcode 11.2
Expected behavior It should display coach mark views smoothly.
Screenshots

Environment:
- Xcode: 11.2
- Device: e.g. iPad 9.7- inch
- iOS version: 13.2
- Dependency Manager: Carthage
Hey @vivek4292, thanks for reporting the issue. I'm unable to reproduce it, would you be able to provide a sample project demonstrating the crash?
Hey, @ephread thanks for the response. I tried this in a separate project with the same environment and it is working fine. But it's still not working in my project.
In the above screenshot:
I'm instantiating an object of CoachMarksController() and passing to a class-level variable.
In the next line, you can see I'm assigning a data source to it. At that moment I checked if its reference is available in memory, I found It was available(see console).
When I move to the next line, I found its data source was nil. Datasource was not assigned.
Moreover, when I checked its memory reference (see console). It was missing and showing error:
"error: Execution was interrupted, reason: EXC_BAD_ACCESS (code=1, address=0x6). The process has been returned to the state before expression evaluation".
The moment I released the breakpoint, the app got crashed on the same line (like the previous screenshot). Please help.
I'm instantiating an object of CoachMarksController() and passing to a class-level variable. In the next line, you can see I'm assigning a data source to it.
This may be a trivial question, but how and where is coacher declared? Asking because it looks a lot like an object that is released too soon.
@ephread Yeah it's a trivial question but I can understand in such case anyone can think of this possible reason. Agreed, it looks like an object is getting released soon.
At first, I declared coacher at class level as lazy.
It was instantiated on first use(not in ViewDidLoad) and it was working fine till I was using Xcode 11.1 When I migrated this to Xcode 11.2.1 It started causing a crash. My thoughts were the same about releasing the object soon so I tried not to use lazy, instantiating in ViedDidLoad(), even instantiate a fresh object in ViewDidLoad() and not using a class-level variable.

But the crash is still there.
I had the same problem with a project I am working on, I solve it by moving the code that was causing the bug to the main queue since that code was directly related to UI. this was in Xcode 13.
How do you move the code to main queue? where do I find the main queue?