From 3e8437ae559487362fae3525beb79c534c213a51 Mon Sep 17 00:00:00 2001
From: 单军华
Date: Thu, 12 Jul 2018 13:44:34 +0800
Subject: [PATCH] bug修复和功能优化
---
screendisplay/screendisplay/Supporting Files/main.m | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 57 insertions(+), 0 deletions(-)
diff --git a/screendisplay/screendisplay/Supporting Files/main.m b/screendisplay/screendisplay/Supporting Files/main.m
new file mode 100644
index 0000000..ac9a546
--- /dev/null
+++ b/screendisplay/screendisplay/Supporting Files/main.m
@@ -0,0 +1,57 @@
+//
+// main.m
+// screendisplay
+//
+// Created by ��������� on 2018/6/29.
+// Copyright �� 2018��� ���������. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "AppDelegate.h"
+
+void UncaughtExceptionHandler(NSException *exception);
+
+
+int main(int argc, char * argv[]) {
+ @autoreleasepool {
+ @try {
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
+ } @catch (NSException *exception) {
+
+ UncaughtExceptionHandler(exception);
+ } @finally {
+ }
+ }
+}
+
+
+// ������������C���������������������������������
+void UncaughtExceptionHandler(NSException *exception) {
+ // ������������exception���������������������������������������������������������������������������������������������������������symbols������������������������������������
+ NSArray *symbols = [exception callStackSymbols];
+ NSString *reason = [exception reason];
+ NSString *name = [exception name];
+ NSString *caches = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES).lastObject;
+
+ NSMutableDictionary *dictM = [NSMutableDictionary dictionaryWithContentsOfFile:[caches stringByAppendingPathComponent:@"zplan_crash.plist"]];
+
+ if (!dictM) {
+ dictM = [NSMutableDictionary dictionary];
+ }
+
+ NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
+ formatter.dateFormat = @"yyyyMMddHHmmssSSS";
+ NSString *timestamp = [formatter stringFromDate:[NSDate date]];
+
+
+ NSDictionary *dict = @{
+ timestamp : @{
+ [timestamp stringByAppendingString:@"name"] : name,
+ [timestamp stringByAppendingString:@"_reason"] : reason,
+ [timestamp stringByAppendingString:@"__symbols"] : symbols
+ }
+ };
+ [dictM setValuesForKeysWithDictionary:dict];
+ [dictM writeToFile:[caches stringByAppendingPathComponent:@"zplan_crash.plist"] atomically:YES];
+
+}
--
Gitblit v1.8.0