1

我有 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];
     }];
4

1 回答 1

1

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

于 2016-02-15T07:31:57.450 回答