Are you issuing the isReady
Key Value Observing notification?
For example, I use a property:
@property (nonatomic, getter = isReady) BOOL ready;
And then have a custom setter:
- (void)setReady:(BOOL)ready
{
[self willChangeValueForKey:@"isReady"];
_ready = ready;
[self didChangeValueForKey:@"isReady"];
}
As well as a custom getter that calls super
:
- (BOOL)isReady
{
return _ready && [super isReady];
}
And, because you implemented both the setter and getter, you have to manually synthesize the property at the beginning of the @implementation
(usually you don't have to do this anymore, but if you implement all of the custom accessors, you have to manually @synthesize
):
@synthesize ready = _ready;
Then, the operation starts when both of the following conditions are satisfied:
The ready
property is set to YES
(note, use the setter, not the ivar directly);
self.ready = YES;
or
[self setReady:YES];
All other standard NSOperation
criteria are satisfied (e.g. dependencies between operations, honoring maxConcurrentOperationCount
, factoring in priorities, etc.).