iOS - 全局异常处理程序 [英] iOS - Global exception handler

查看:177
本文介绍了iOS - 全局异常处理程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法为iPhone应用程序实现全局异常处理程序,例如,而不是默默地崩溃应用程序,可能允许某种消息?

Is there anyway to implement a global exception handler for iPhone apps such that exceptions, instead of silently crashing the app, could allow for some sort of message?

我可以理解,由于程序可能处于不一致的状态,因为它是不可能的,但至少告诉用户这是很好的对不起 - 出了问题!

I can understand if it's not do-able since the program may be in an inconsistent state, but it'd be nice to at least tell users "Sorry - something went wrong!"

谢谢!

推荐答案

检查这个问题的答案。这似乎表明您将获得垃圾堆栈跟踪,但您绝对可以设置一个全局异常处理程序。祝你好运!

Check this question for the answer. It seems to indicate that you'll be getting junky stack traces, but you definitely can set a global exception handler. Good luck!

这篇关于iOS - 全局异常处理程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆