重试 RACObserve 直到成功
Retrying RACObserve until success
我有 RACObserve 块,我想重试调用直到成功 returns。所以它不会显示错误消息,但会重试获取。
感谢您的帮助!
[[[[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
。
我有 RACObserve 块,我想重试调用直到成功 returns。所以它不会显示错误消息,但会重试获取。 感谢您的帮助!
[[[[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
。