0
如何在应用程序级别处理所有未处理的异常?我试过NSSetUncaughtExceptionHandler
,它只调用NSExceptions。appdelegate swift中未捕获的异常3
我想要处理未捕获的应用程序级别的异常,并允许用户通过导航到主页(某些)来继续应用程序而不会发生任何崩溃。
如何在应用程序级别处理所有未处理的异常?我试过NSSetUncaughtExceptionHandler
,它只调用NSExceptions。appdelegate swift中未捕获的异常3
我想要处理未捕获的应用程序级别的异常,并允许用户通过导航到主页(某些)来继续应用程序而不会发生任何崩溃。
我建议你在代码中使用try catch块。这将有助于防止应用程序中的崩溃。
do {
try {
// do something here
// if the call fails, the catch block is executed
}
} catch {
//do something when catch block executes.
}