【发布时间】:2012-06-13 12:05:37
【问题描述】:
我想在其他线程(在其他线程中有文本到语音)时显示警报视图。 简而言之,我想同时调用两种方法,并希望它们同时“工作”。
但在我的情况下,我正在启动 alertView,屏幕变暗并且没有 alertview,另一个线程启动。其他线程准备好后,我得到蓝色警报视图:
这是代码,我的问题是:waitUntilAllOperationsAreFinished 的等价物是什么?
dispatch_async(dispatch_get_main_queue(), ^{
[self alertWhileTTS];
});
[[self view] setNeedsDisplay];
[self synthesizeInBackground];
[queue waitUntilAllOperationsAreFinished];
[self setIsSpeaking: false];
[[self view] setNeedsDisplay];
另请参阅此帖子:How to multithred correctly? UIAlertView is not displayed, only gray screen
【问题讨论】:
标签: multithreading asynchronous uialertview nsoperationqueue dispatch