dispatches network request start / end notifications asynchronously
Signed-off-by: Mattt Thompson <m@mattt.me>
This commit is contained in:
parent
732cd2da02
commit
7b685fe35e
1 changed files with 13 additions and 11 deletions
|
|
@ -332,16 +332,18 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
|
||||||
[self didChangeValueForKey:oldStateKey];
|
[self didChangeValueForKey:oldStateKey];
|
||||||
[self didChangeValueForKey:newStateKey];
|
[self didChangeValueForKey:newStateKey];
|
||||||
|
|
||||||
switch (state) {
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
case AFOperationExecutingState:
|
switch (state) {
|
||||||
[[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingOperationDidStartNotification object:self];
|
case AFOperationExecutingState:
|
||||||
break;
|
[[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingOperationDidStartNotification object:self];
|
||||||
case AFOperationFinishedState:
|
break;
|
||||||
[[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingOperationDidFinishNotification object:self];
|
case AFOperationFinishedState:
|
||||||
break;
|
[[NSNotificationCenter defaultCenter] postNotificationName:AFNetworkingOperationDidFinishNotification object:self];
|
||||||
default:
|
break;
|
||||||
break;
|
default:
|
||||||
}
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
[self.lock unlock];
|
[self.lock unlock];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue