Permalink
Browse files

Fixing another delay < 0

  • Loading branch information...
1 parent a2e16e0 commit 096b536ae721325b058f990c76c8a175bc018cb1 @gabriel gabriel committed May 29, 2012
Showing with 7 additions and 3 deletions.
  1. +7 −3 Classes/Mock/GHMockNSURLConnection.m
@@ -67,9 +67,13 @@ - (void)cancel {
#pragma mark -
- (void)receiveData:(NSData *)data afterDelay:(NSTimeInterval)delay {
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, delay * NSEC_PER_SEC), dispatch_get_current_queue(), ^{
- [delegate_ connection:nil didReceiveData:data];
- });
+ if (delay < 0) {
+ [delegate_ connection:(NSURLConnection *)self didReceiveData:data];
+ } else {
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, delay * NSEC_PER_SEC), dispatch_get_current_queue(), ^{
+ [delegate_ connection:(NSURLConnection *)self didReceiveData:data];
+ });
+ }
}
- (NSData *)loadDataFromPath:(NSString *)path {

0 comments on commit 096b536

Please sign in to comment.