NSOperation 存在于 NSOperationQueue 上
有谁知道一种方法来判断 NSOperation 是否已经在 NSOperationQueue 上,而无需实际获取操作列表并与每个项目进行比较?
提前致谢,
Does anyone know a way of telling if an NSOperation is already on a NSOperationQueue without having to actually get the list of operations and compare with each of the items?
Thanks in advance,
你必须拿到这份清单,但这并不那么费力。如果
queue
和operation
是您的对象:[[queue actions] containsObject:operation];
You have to get the list, but it's not that taxing. If
queue
andoperation
are your objects:[[queue operations] containsObject:operation];