开发者

NSOperation exists on NSOperationQueue

开发者 https://www.devze.com 2023-02-09 17:55 出处:网络
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?

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, 开发者_StackOverflow中文版


You have to get the list, but it's not that taxing. If queue and operation are your objects:

[[queue operations] containsObject:operation];

0

精彩评论

暂无评论...
验证码 换一张
取 消