I have a subclass NSOperationthat I want to run at the same time.
I understand that for simultaneous operations:
- I need to determine
isConcurrentfor a refund YES. - I need to define a method
start - I need to send a KVO notice for
isExecutingand isFinishedwhen it will be done. - Usage
@synthesizewill automatically send appropriate KVO notifications when the values ββfor isExecutingand are changed isFinished.
Despite this, I confirmed that my turn never moves on to the next element.
Here is the meat of my code:
@interface MyOperation()
@property (readwrite) BOOL isExecuting;
@property (readwrite) BOOL isFinished;
@end
@implementation MyOperation
- (void)start
{
@autoreleasepool {
self.isExecuting = YES;
self.HTTPOperation = [[AFHTTPRequestOperation alloc] initWithRequest: URLRequest];
_HTTPOperation.completionBlock = [^{
[self completed];
self.isExecuting = NO;
self.isFinished = YES;
} copy];
[_HTTPOperation start];
}
}
- (BOOL)isConcurrent
{
return YES;
}
- (void)completed
{
}
@end
What am I missing?
(This is on the iPhone, but I canβt imagine that it matters.)