UIAlertView wait_fences:未能收到回复:10004003

Posted

技术标签:

【中文标题】UIAlertView wait_fences:未能收到回复:10004003【英文标题】:UIAlertView wait_fences: failed to receive reply: 10004003 【发布时间】:2013-01-04 16:20:52 【问题描述】:

当我想在没有互联网连接时提醒用户时收到此错误

请帮帮我,这是我的代码:

- (void)viewDidAppear:(BOOL)animated

[super viewDidAppear:animated];
    __block UIAlertView *alert = nil; 
//---------- Check Connection -------
// allocate a reachability object
Reachability* reach = [Reachability reachabilityWithHostname:@"www.google.com"];

// set the blocks
reach.unreachableBlock = ^(Reachability*reach) // not connected

    //NSLog(@"UNREACHABLE!");
    alert =
    [[UIAlertView alloc]
     initWithTitle: @"No Network Connection!"
     message:@"Sorry, we can't currently connect you to the app. Please check your internet connection."
     delegate:nil
     cancelButtonTitle:@"OK"
     otherButtonTitles:nil];

    [alert show];
    //[alert release];

;

reach.reachableBlock = ^(Reachability*reach)

    //NSLog(@"REACHABLE!");
;

// start the notifier which will cause the reachability object to retain itself!
[reach startNotifier];


错误是“wait_fences: failed to receive reply: 10004003” 有什么建议么?

【问题讨论】:

也许这个帖子可以帮助你,***.com/questions/1371346/… ***.com/a/9266196/716216 我以前看过这个帖子,但不幸的是它没有帮助,我的视图中没有任何文字。 【参考方案1】:

我之前遇到过类似的问题。因为我试图在一个块中显示警报视图。

我将以下行添加到我的块中,而不是 [alert show]; 并且一切正常。

[alertview performSelectorOnMainThread:@selector(show) withObject:nil waitUntilDone:false];

尝试仅从主线程更新您的UI,否则会导致问题或显示不可预测的结果。

【讨论】:

@user1789976: 很高兴 :) 感谢您的评论 :)

以上是关于UIAlertView wait_fences:未能收到回复:10004003的主要内容,如果未能解决你的问题,请参考以下文章

wait_fences:未能收到回复:10004003 错误 - UIAlertView 与 UIActivityIndi​​catorView

UIAlertView wait_fences:未能收到回复:10004003

wait_fences:未能收到回复:10004003 - viewDidLoad

当我从另一个警报创建警报时,我得到 wait_fences: failed to receive reply

RMUniversalAlert 的错误 - UIAlertView+Blocks/UIAlertView+Blocks.h 未找到

为啥我会收到此代码的“wait_fences:未能收到回复”?