Updating documentation for -pause

Returning early for -pause if operation is already cancelled
This commit is contained in:
Mattt Thompson 2012-07-23 16:22:48 -07:00
parent 70787ce4cf
commit b9641edc81
2 changed files with 2 additions and 2 deletions

View file

@ -159,7 +159,7 @@ extern NSString * const AFNetworkingOperationDidFinishNotification;
/** /**
Pauses the execution of the request operation. Pauses the execution of the request operation.
@discussion A paused operation returns `NO` for `-isReady`, `-isExecuting`, and `-isFinished`. As such, it will remain in an `NSOperationQueue` until it is either cancelled or resumed. Pausing a finished or cancelled operation has no effect. @discussion A paused operation returns `NO` for `-isReady`, `-isExecuting`, and `-isFinished`. As such, it will remain in an `NSOperationQueue` until it is either cancelled or resumed. Pausing a finished, cancelled, or paused operation has no effect.
*/ */
- (void)pause; - (void)pause;

View file

@ -355,7 +355,7 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
} }
- (void)pause { - (void)pause {
if ([self isPaused] || [self isFinished]) { if ([self isPaused] || [self isFinished] || [self isCancelled]) {
return; return;
} }