我已经运行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
我想删除该警告。 任何帮助??
答案 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 ..."];
});