|
|
@@ -529,6 +529,8 @@ void UncaughtExceptionHandler(NSException *exception) {
|
|
|
|
|
|
- (void)handleUrgencyFile {
|
|
|
|
|
|
+ [self readUrgencyCache];
|
|
|
+
|
|
|
NSLog(@"urgencyDic: %@",self.urgencyDic);
|
|
|
if (self.urgencyDic.allKeys.count) {
|
|
|
|
|
|
@@ -677,7 +679,8 @@ void UncaughtExceptionHandler(NSException *exception) {
|
|
|
NSString *cachePath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject];
|
|
|
NSString *urgencyFile = [cachePath stringByAppendingPathComponent:[NSString stringWithFormat:@"%@_urgency",self.user]];
|
|
|
|
|
|
- [NSKeyedArchiver archiveRootObject:self.urgencyDic toFile:urgencyFile];
|
|
|
+// [NSKeyedArchiver archiveRootObject:self.urgencyDic toFile:urgencyFile];
|
|
|
+ [self.urgencyDic writeToFile:urgencyFile atomically:NO];
|
|
|
}
|
|
|
|
|
|
- (void)readUrgencyCache {
|
|
|
@@ -688,7 +691,8 @@ void UncaughtExceptionHandler(NSException *exception) {
|
|
|
|
|
|
if ([manager fileExistsAtPath:urgencyFile]) {
|
|
|
|
|
|
- _urgencyDic = [NSKeyedUnarchiver unarchiveObjectWithFile:urgencyFile];
|
|
|
+// _urgencyDic = [NSKeyedUnarchiver unarchiveObjectWithFile:urgencyFile];
|
|
|
+ _urgencyDic = [NSMutableDictionary dictionaryWithContentsOfFile:urgencyFile];
|
|
|
[manager removeItemAtPath:urgencyFile error:nil];
|
|
|
|
|
|
} else {
|
|
|
@@ -699,7 +703,6 @@ void UncaughtExceptionHandler(NSException *exception) {
|
|
|
|
|
|
- (void)initialExceptionHandler {
|
|
|
NSSetUncaughtExceptionHandler(&UncaughtExceptionHandler);
|
|
|
- [self readUrgencyCache];
|
|
|
}
|
|
|
|
|
|
- (void)becomeObserver {
|