Skip to content

Commit

Permalink
Fix Bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
drewconner committed Apr 11, 2014
1 parent ee413fa commit 0e9baae
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ChimpKit3/ChimpKit.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ + (ChimpKit *)sharedKit {
dispatch_once(&pred, ^{
_sharedKit = [[self alloc] init];
_sharedKit.timeoutInterval = kDefaultTimeoutInterval;
_sharedKit.requests = [[NSMutableDictionary alloc] init];
});

return _sharedKit;
Expand Down Expand Up @@ -164,10 +165,10 @@ - (NSUInteger)callApiMethod:(NSString *)aMethod withApiKey:(NSString *)anApiKey
requestWrapper.delegate = aDelegate;
requestWrapper.completionHandler = aHandler;

[self.requests setObject:requestWrapper forKey:[NSNumber numberWithUnsignedInteger:[dataTask taskIdentifier]]];

[dataTask resume];

[self.requests setObject:requestWrapper forKey:[NSNumber numberWithUnsignedInteger:[dataTask taskIdentifier]]];

return [dataTask taskIdentifier];
}

Expand Down Expand Up @@ -217,7 +218,7 @@ - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didComp
}
}

[self.requests removeObjectForKey:[NSNumber numberWithUnsignedInteger:[requestWrapper.dataTask taskIdentifier]]];
[self.requests removeObjectForKey:[NSNumber numberWithUnsignedInteger:[task taskIdentifier]]];
}


Expand Down

0 comments on commit 0e9baae

Please sign in to comment.