|
@@ -9,7 +9,7 @@
|
|
|
|
|
|
@interface appToTVManager ()
|
|
|
{
|
|
|
- NSTimer *CheckSecondTimer; //
|
|
|
+
|
|
|
}
|
|
|
@property(nonatomic,strong)NSMutableArray *waitingArr;//等待安装的app列表
|
|
|
@property (nonatomic, strong) NSArray *installingArr;//正在安装的APP列表
|
|
@@ -32,12 +32,13 @@
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ NSString *sucTip = NSLocalizedString(@"nas_install_To_TV_task_ok",nil);
|
|
|
+ [[iToast makeText:sucTip] show];
|
|
|
+
|
|
|
//第一次进入 安装中 待安装的都没有
|
|
|
if(!_installingArr && !_waitingArr){
|
|
|
_installingArr = [NSArray arrayWithArray:list];
|
|
|
-
|
|
|
_installindex = 0;
|
|
|
- [self beginToTVFun];
|
|
|
}
|
|
|
else{
|
|
|
|
|
@@ -76,19 +77,10 @@
|
|
|
[_waitingArr addObjectsFromArray:installList];
|
|
|
}
|
|
|
|
|
|
- if (CheckSecondTimer) {
|
|
|
- [CheckSecondTimer invalidate];
|
|
|
- }
|
|
|
-
|
|
|
-// CheckSecondTimer = [NSTimer scheduledTimerWithTimeInterval:10.0 target:self selector:@selector(timerChange) userInfo:nil repeats:YES];
|
|
|
-// [[NSRunLoop currentRunLoop] addTimer:CheckSecondTimer forMode:NSRunLoopCommonModes];
|
|
|
+ [self beginToTVFun];
|
|
|
}
|
|
|
|
|
|
-- (void)timerChange{
|
|
|
-// if (_installindex < _installingArr.count) {
|
|
|
-//
|
|
|
-// }
|
|
|
-}
|
|
|
+
|
|
|
|
|
|
- (void)beginToTVFun
|
|
|
{
|
|
@@ -102,9 +94,8 @@
|
|
|
}
|
|
|
else {
|
|
|
_installingArr = @[];
|
|
|
- if (CheckSecondTimer) {
|
|
|
- [CheckSecondTimer invalidate];
|
|
|
- }
|
|
|
+ HLog(@"安装任务完成")
|
|
|
+ return;
|
|
|
}
|
|
|
}
|
|
|
else{
|
|
@@ -125,13 +116,20 @@
|
|
|
SuperModel *model = [[SuperModel alloc] initWithDictionary:responseObject error:nil];
|
|
|
|
|
|
if(model && model.status == 0){
|
|
|
-
|
|
|
+ NSString *sucTip = [[NSString alloc] initWithFormat:@"%@%@",installModel.name,NSLocalizedString(@"nas_install_To_TV_suc_tip",nil)];
|
|
|
+ [[iToast makeText:sucTip] show];
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ NSString *sucTip = [[NSString alloc] initWithFormat:@"%@%@",installModel.name,NSLocalizedString(@"nas_install_To_TV_fail_tip",nil)];
|
|
|
+ [[iToast makeText:sucTip] show];
|
|
|
}
|
|
|
-
|
|
|
weakSelf.installindex++;
|
|
|
[weakSelf beginToTVFun];
|
|
|
|
|
|
} failure:^(NSError * _Nonnull error) {
|
|
|
+ NSString *sucTip = [[NSString alloc] initWithFormat:@"%@%@",installModel.name,NSLocalizedString(@"nas_install_To_TV_fail_tip",nil)];
|
|
|
+ [[iToast makeText:sucTip] show];
|
|
|
+
|
|
|
weakSelf.installindex++;
|
|
|
[weakSelf beginToTVFun];
|
|
|
}];
|