UIAlertView:wait_fences:未能收到回复:10004003

时间:2013-04-10 07:20:25

标签: iphone ios ipad

我已经运行UIAlertView,但在从Webservice获取数据期间,我想更新该AlertView的消息。所以我写下代码来更新警告信息:

[self performSelectorOnMainThread:@selector(UpdateAlertMessage:) withObject:@"Downloading Schedule ..." waitUntilDone:NO];

-(void)UpdateAlertMessage:(NSString *)strMessage
{appDelegate.progressAlert.message=strMessage;
}

此处进度警报是我已经运行的警报视图。

但我在控制台中给出了以下警告:

wait_fences: failed to receive reply: 10004003

我想删除该警告。 任何帮助??

1 个答案:

答案 0 :(得分:0)

你是在主线程上做的,所以尝试使用GCD方法而不是[self performSelectorOnMainThread:@selector(UpdateAlertMessage:) withObject:@"Downloading Schedule ..." waitUntilDone:NO];

像这样

dispatch_async(dispatch_get_main_queue(), ^{ 
  [self UpdateAlertMessage:@"Downloading Schedule ..."];
});

<强>更新

dispatch_queue_t myQueue;
myQueue = dispatch_queue_create("myQueue", NULL);
dispatch_sync(myQueue, ^{
    [self UpdateAlertMessage:@"Downloading Schedule ..."];
});