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

最佳答案

预订之前,在调用链的最后一点使用retry方法。

关于ios - 重试RACObserve直到成功,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/35402424/

10-12 06:01