|
@@ -44,7 +44,6 @@
|
|
|
self.companyName = nil;
|
|
self.companyName = nil;
|
|
|
self.companyIcon = nil;
|
|
self.companyIcon = nil;
|
|
|
self.modeList = nil;
|
|
self.modeList = nil;
|
|
|
- [self saveUploadTasks];
|
|
|
|
|
[[NSNotificationCenter defaultCenter] postNotificationName:LogoutNotification object:nil];
|
|
[[NSNotificationCenter defaultCenter] postNotificationName:LogoutNotification object:nil];
|
|
|
|
|
|
|
|
[self showLoginVC];
|
|
[self showLoginVC];
|
|
@@ -85,13 +84,13 @@
|
|
|
|
|
|
|
|
void UncaughtExceptionHandler(NSException *exception) {
|
|
void UncaughtExceptionHandler(NSException *exception) {
|
|
|
AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
|
AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
|
|
- if (!appDelegate.user) {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// if (!appDelegate.user) {
|
|
|
|
|
+// return;
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
- if (appDelegate.uploadManager.arr_queue.count) {
|
|
|
|
|
|
|
+// if (appDelegate.uploadManager.arr_queue.count) {
|
|
|
[appDelegate saveUploadTasks];
|
|
[appDelegate saveUploadTasks];
|
|
|
- }
|
|
|
|
|
|
|
+// }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- (void)setUpUncaughtExceptionHandler {
|
|
- (void)setUpUncaughtExceptionHandler {
|
|
@@ -106,13 +105,6 @@ void UncaughtExceptionHandler(NSException *exception) {
|
|
|
if(self.uploadManager.arr_queue!=nil)
|
|
if(self.uploadManager.arr_queue!=nil)
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
-// NSMutableArray *tmpArr = [NSMutableArray array];
|
|
|
|
|
-// for (NSDictionary *dic in self.uploadManager.arr_queue) {
|
|
|
|
|
-// NSMutableDictionary *mutDic = [dic mutableCopy];
|
|
|
|
|
-// [mutDic removeObjectForKey:@"operation"];
|
|
|
|
|
-// [mutDic removeObjectForKey:@"status"];
|
|
|
|
|
-// [tmpArr addObject:mutDic];
|
|
|
|
|
-// }
|
|
|
|
|
[self.uploadManager stopAllTasks];
|
|
[self.uploadManager stopAllTasks];
|
|
|
[self.uploadManager saveTasks];
|
|
[self.uploadManager saveTasks];
|
|
|
|
|
|
|
@@ -120,19 +112,7 @@ void UncaughtExceptionHandler(NSException *exception) {
|
|
|
}
|
|
}
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- NSString *path = [[RAUtils appCacheDirectory] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@_uploadTasks",self.user]];
|
|
|
|
|
- NSMutableArray *tmpArr = [NSMutableArray array];
|
|
|
|
|
- for (NSDictionary *dic in self.uploadManager.arr_queue) {
|
|
|
|
|
- NSMutableDictionary *mutDic = [dic mutableCopy];
|
|
|
|
|
- [mutDic removeObjectForKey:@"operation"];
|
|
|
|
|
- [mutDic removeObjectForKey:@"status"];
|
|
|
|
|
- [tmpArr addObject:mutDic];
|
|
|
|
|
- }
|
|
|
|
|
- BOOL success = [tmpArr writeToFile:path atomically:NO];
|
|
|
|
|
- [self.uploadManager.arr_queue removeAllObjects];
|
|
|
|
|
- if (success) {
|
|
|
|
|
- DebugLog(@"Save Task Success");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- (NSMutableArray *)cachedUploadTasks {
|
|
- (NSMutableArray *)cachedUploadTasks {
|