NSOperationQueue
オブジェクトには、というプロパティがありますoperations
。
キューへの参照がある場合は、簡単に確認できます。
NSArrayの操作に次のNSOperation
ようなものが含まれているかどうかを確認できます。
NSOperationQueue *queue = [[NSOperationQueue alloc] init];
NSOperation *operation = [[NSOperation alloc] init];
[queue addOperation:operation];
if([queue operations] containsObject:operation])
NSLog(@"Operation is in the queue");
else
NSLog(@"Operation is not in the queue");
または、すべてのオブジェクトを反復処理できます。
for(NSOperation *op in [queue operations])
if (op==operation) {
NSLog(@"Operation is in the queue");
}
else {
NSLog(@"Operation is not in the queue");
}
これがあなたが探しているものであるかどうか教えてください。
または、NSOperation
オブジェクトには、状態を確認できるいくつかのプロパティがあります。など:isExecuting
、、、isFinished
などisCancelled
..。