gpt4 book ai didi

iphone - 另一个 "wait_fences: failed to receive reply"问题 (UIAlertView)

转载 作者:行者123 更新时间:2023-12-03 19:25:41 25 4
gpt4 key购买 nike

此论坛上已经有很多关于“wait_fences:未能收到回复”的问题,但所提出的解决方案都不适合我(尽管它们确实帮助我缓解了这个问题)。

当我的应用程序启动时,我会进行可达性检查,如果我无法到达我正在寻找的主机,我会弹出一个 UIAlertView。最初,我什至在设置 View Controller 之前就这样做了,但后来我了解到“wait_fences”问题的原因之一是,如果您尚未显示 View ,则响应者链未正确设置 - 所以我将所有内容移至 -viewDidAppear 中。基本上,这就是我所拥有的:

- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];

// Figure out what the reflections name is, then check to see if it can find it online;
// If it can't, -informUserSiteIsNotReachable is called, below
[self retrieveReflectionByName:self.todaysReflectionName];

[self displayReflectionByName:self.todaysReflectionName];
}

- (void)informUserSiteIsNotReachable
{
SEL messageSelector;

if (NO == [self internetIsReachable]) {
messageSelector = @selector(internetNotAccessible);
} else {
messageSelector = @selector(reflectionsSiteNotAccessible);
}
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:[Strings alertViewTitleWhenSiteIsUnreachable] message:[Strings performSelector:messageSelector] delegate:self cancelButtonTitle:@"OK" otherButtonTitles:NULL];
[alert show];
[alert release];
}

我似乎无法摆脱 wait_fences 问题:有什么建议吗?

最佳答案

在这里,我在项目中也遇到了同样的问题,我解决了“wait_fences”问题。

您可以在此处对代码进行一项更改,如下所示:

- (void)informUserSiteIsNotReachable 
{
SEL messageSelector;

if (NO == [self internetIsReachable]) {
messageSelector = @selector(internetNotAccessible);
} else {
messageSelector = @selector(reflectionsSiteNotAccessible);
}

[NSTimer scheduledTimerWithTimeInterval:0.001 target:self selector:@selector(Show_AlertMessage) userInfo:nil repeats:NO];
}

- (void) Show_AlertMessage
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:[Strings alertViewTitleWhenSiteIsUnreachable] message:[Strings performSelector:messageSelector] delegate:self cancelButtonTitle:@"OK" otherButtonTitles:NULL];
[alert show];
[alert release];
}

这对我有用。希望您尽快解决这个 wait_fences 问题。如果您仍然遇到问题,请告诉我。

关于iphone - 另一个 "wait_fences: failed to receive reply"问题 (UIAlertView),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3207071/

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