Skip to content

Instantly share code, notes, and snippets.

@sandosh
Created August 26, 2011 01:18
Show Gist options
  • Save sandosh/1172463 to your computer and use it in GitHub Desktop.
Save sandosh/1172463 to your computer and use it in GitHub Desktop.
diff --git a/AFNetworking/AFHTTPRequestOperation.m b/AFNetworking/AFHTTPRequestOperation.m
index bc3ca48..a97bcbf 100644
--- a/AFNetworking/AFHTTPRequestOperation.m
+++ b/AFNetworking/AFHTTPRequestOperation.m
@@ -147,6 +147,7 @@ static inline BOOL AFHTTPOperationStateTransitionIsValid(AFHTTPOperationState fr
}
- (void)dealloc {
+ NSLog(@"Deallocing ...... %@", [self class]);
[_runLoopModes release];
[_request release];
diff --git a/AFNetworking/AFRestClient.m b/AFNetworking/AFRestClient.m
index 2062c55..0dca4d6 100644
--- a/AFNetworking/AFRestClient.m
+++ b/AFNetworking/AFRestClient.m
@@ -130,9 +130,11 @@ static NSStringEncoding const kAFRestClientStringEncoding = NSUTF8StringEncoding
if ([request URL] == nil || [[request URL] isEqual:[NSNull null]]) {
return;
}
-
+ NSLog(@"Adding operation");
AFHTTPRequestOperation *operation = [AFJSONRequestOperation operationWithRequest:request success:success failure:failure];
[self.operationQueue addOperation:operation];
+ [operation performSelector:@selector(cancel) withObject:nil afterDelay:.5];
+
}
- (void)cancelHTTPOperationsWithRequest:(NSURLRequest *)request {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment