|
@@ -78,7 +78,6 @@
|
|
|
}];
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- (void)operationAction:(SETTINGACTION)type {
|
|
|
switch (type) {
|
|
|
case SETTINGACTION_ADDRESS:
|
|
@@ -146,24 +145,35 @@
|
|
|
}
|
|
|
|
|
|
|
|
|
-//
|
|
|
-
|
|
|
- (void)clearCache {
|
|
|
+ [VoNetworking clearDownloadData];
|
|
|
if (COURSEWARE_MANAGER.isDownloading) { // 如果在下载 取消
|
|
|
[COURSEWARE_MANAGER cancleDownloadCourseware];
|
|
|
}
|
|
|
-
|
|
|
NSString *documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
|
|
|
NSString *bundlePath = [documentsPath stringByAppendingPathComponent:@"CoursewarePath"];
|
|
|
NSFileManager *fileManager = [NSFileManager defaultManager];
|
|
|
BOOL isExist = [fileManager fileExistsAtPath:bundlePath];
|
|
|
+ BOOL isSuccessClearCourseware = NO;
|
|
|
if (isExist) {
|
|
|
- BOOL isSuccess = [fileManager removeItemAtPath:bundlePath error:nil];
|
|
|
- if (isSuccess) {
|
|
|
- [LOADING_MANAGER MBShowAUTOHidingInWindow:@"清理完成"];
|
|
|
- }
|
|
|
+ isSuccessClearCourseware = [fileManager removeItemAtPath:bundlePath error:nil];
|
|
|
}
|
|
|
else {
|
|
|
+ isSuccessClearCourseware = YES;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ NSString *accompanyCachePath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject];
|
|
|
+ NSString *accompanyFilePath= [accompanyCachePath stringByAppendingPathComponent:@"AccompanySong"];
|
|
|
+ BOOL isAccompanySongExist = [fileManager fileExistsAtPath:accompanyFilePath];
|
|
|
+ BOOL isSuccessClearAccompany = NO;
|
|
|
+ if (isAccompanySongExist) {
|
|
|
+ isSuccessClearAccompany = [fileManager removeItemAtPath:accompanyFilePath error:nil];
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ isSuccessClearAccompany = YES;
|
|
|
+ }
|
|
|
+ if (isSuccessClearCourseware && isSuccessClearAccompany) {
|
|
|
[LOADING_MANAGER MBShowAUTOHidingInWindow:@"清理完成"];
|
|
|
}
|
|
|
}
|