假设我在后台线程中。假设我想在主线程上执行一些东西并等到它完成。
我该怎么做?
我想我能做到
[[NSOperationQueue new] addOperationWithBlock:^{
[[NSOperationQueue mainQueue]addOperationWithBlock:^{
//Do something on main queue
[[NSOperationQueue new] addOperationWithBlock:^{
//Do something after finish
}];
}];
}];
我想做类似的事情
//do stuff
[[NSOperationQueue mainQueue]addOperationWithBlockAndWaitTillFinished:^{
//Do something on main queue
}];
//Do something after finish