我有類MyOperation : NSOperation
與@property (nonatomic, retain) NSString *oID;
NSOperationQueue操作filteredArrayUsingPredicate錯誤
有時我需要取消操作具體oID
。我試圖做到這一點:
NSArray *operations = operationQueue.operations;
NSPredicate *predicate = [NSPredicate predicateWithFormat:[NSString stringWithFormat: @"oID == %@", _specificID]];
NSArray *arrayOperations = [operations filteredArrayUsingPredicate: predicate];
,並得到錯誤:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unable to parse the format string "oID == 0f5db97b-f127-4425-ad79-451d1f204016"'
是否有可能從NSOperationQueue過濾操作?
正確!這是一個錯誤,多麼愚蠢=)Thx! – 2012-08-15 21:55:06