我正在按照Matt Ghallagher performSelector:onThread:withObject:waitUntilDone:的建议测试tutorial进行线程间通信。事实证明,对于实时音频应用来说,它非常慢,而且几乎no good。有什么建议?
答案 0 :(得分:0)
在主线上:
AnyClass myObject;
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
// do asynchronous work
// environment objects and variables will be available
[myObject doSomething];
});
它真的没有比那更简单......