【问题标题】:Retrying RACObserve until success重试 RACObserve 直到成功
【发布时间】:2016-02-15 05:59:47
【问题描述】:

我有 RACObserve 块,我想重试调用,直到它成功返回。所以它不会显示错误消息,但它会重试获取。 感谢您的帮助!

    [[[[RACObserve(self, currentLocation)
        ignore:nil]

       flattenMap:^(CLLocation *newLocation) {
           return [RACSignal merge:@[
                                     [self updateCurrentConditions],
                                     [self updateDailyForecast],
                                     [self updateHourlyForecast]
                                     ]];

       }] deliverOn:RACScheduler.mainThreadScheduler]

     subscribeError:^(NSError *error) {
         [TSMessage showNotificationWithTitle:@"Error"
                                     subtitle:@"There was a problem fetching the latest weather."
                                         type:TSMessageNotificationTypeError];
     }];

【问题讨论】:

    标签: ios xcode reactive-cocoa racsignal


    【解决方案1】:

    在订阅前调用链的最后一点使用方法retry

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-02-16
      • 1970-01-01
      • 2018-01-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-04-21
      相关资源
      最近更新 更多