捕获IOS APP中出现的异常
2015-10-10 13:12
246 查看
void UncaughtExceptionHandler(NSException *exception)
{
NSArray *arr = [exception callStackSymbols];
NSString *reason = [exception reason];
NSString *name = [exception name];
NSString *exceptionStr = [NSString stringWithFormat:@"IOS Exception -- Version:%@\nName:%@\nReasion:%@\nCallStack:\n%@",
[[NSBundle mainBundle] infoDictionary][@"CFBundleVersion"],
name,
reason,
[arr componentsJoinedByString:@"\n"]];
NSLog(@"%@+++++++++++++EEROR", exceptionStr);
}
此异常的调用方法
NSSetUncaughtExceptionHandler(&UncaughtExceptionHandler);
我通常在
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
这个方法中调用
相关文章推荐
- unfortunately,the process com.android.phone has stopped问题解决
- UIWebView去掉底部背景
- 微信支付之H5页面WAP端接入
- IOS 推送
- IOS控件 动画操作 与 CALayer 简单操作
- IOS 系统文字转英文字母
- IOS delegate注册推送
- IOS横屏事件
- IOS汉字排序
- Android之ButterKnife--View注入框架
- iOS开展-clang: error: unknown argument: '-websockets'解决方案
- iOS流量监控
- ios子控件超过了父控件的frame范围,超过的部分不显示
- App-UI测试的主要内容
- Android悬浮窗实现 使用WindowManager
- Android 自定义Galley中图片未居中显示问题
- android ndk Application.mk
- Swift字典
- iOS开发中@property的属性weak nonatomic strong readonly等介绍
- ios开发中WebView,去除(自定义)JS中Alert显示的网址