gpt4 book ai didi

ios - 重试 RACObserve 直到成功

转载 作者:行者123 更新时间:2023-11-29 12:04:57 28 4
gpt4 key购买 nike

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

    [[[[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/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com