You have a major misunderstanding about compilation errors, if you had a compilation error then your app would not even run. A compilation error means there is a syntactical error in your code, and it is nothing to do with a run time error.
You probably have an exception, in which case add code like this at the start of your app and then add a breakpoint to the logging line. The breakpoint will be hit when you run the app if that is the problem, then you can see the call stack.
func registerExceptionHandler() {
NSSetUncaughtExceptionHandler { (exception) in
NSLog("‼️‼️ Uncaught exception (String(describing: exception.reason))")
}
}
You can also extract a crash stack from the phone using Xcode