我正在使用Multiple NSOperationQueue
来创建 View
。
为了创建UIViews
,我使用多个类
。
我正在后台创建View
,但现在我想在 UIScrollView 中添加为 subview
,因为我需要切换到主队列
。
我正在添加 UIScrollView
,如下所示。
[self.scrollView addSubview:pageView];
为了创建NSOperationQueue
,我使用以下方式。
NSOperationQueue *queue = [[NSOperationQueue alloc] init];
[queue addOperationWithBlock:^{
// My code for background process.
// Calling other class method for adding view as subview.
}];
我如何检查[NSOperationQueue currentQueue]
是mainQueue
。?
提前致谢。
最佳答案
[NSOperationQueue currentQueue] == [NSOperationQueue mainQueue];
关于ios - 我如何检查 currentQueue 是主队列。?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27730275/