diff --git a/Classes/ASIFormDataRequest.m b/Classes/ASIFormDataRequest.m index 6cf72802..e13ab0ad 100644 --- a/Classes/ASIFormDataRequest.m +++ b/Classes/ASIFormDataRequest.m @@ -30,7 +30,7 @@ @implementation ASIFormDataRequest #pragma mark utilities - (NSString*)encodeURL:(NSString *)string { - NSString *newString = NSMakeCollectable([(NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)string, NULL, CFSTR(":/?#[]@!$ &'()*+,;=\"<>%{}|\\^~`"), CFStringConvertNSStringEncodingToEncoding([self stringEncoding])) autorelease]); + NSString *newString = [NSMakeCollectable(CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)string, NULL, CFSTR(":/?#[]@!$ &'()*+,;=\"<>%{}|\\^~`"), CFStringConvertNSStringEncodingToEncoding([self stringEncoding]))) autorelease]; if (newString) { return newString; } diff --git a/Classes/ASIHTTPRequest.m b/Classes/ASIHTTPRequest.m index 0164d6ab..8131ca4e 100644 --- a/Classes/ASIHTTPRequest.m +++ b/Classes/ASIHTTPRequest.m @@ -1519,7 +1519,7 @@ - (void)checkRequestStatus [self setLastBytesSent:totalBytesSent]; // Find out how much data we've uploaded so far - [self setTotalBytesSent:[NSMakeCollectable([(NSNumber *)CFReadStreamCopyProperty((CFReadStreamRef)[self readStream], kCFStreamPropertyHTTPRequestBytesWrittenCount) autorelease]) unsignedLongLongValue]]; + [self setTotalBytesSent:[[NSMakeCollectable(CFReadStreamCopyProperty((CFReadStreamRef)[self readStream], kCFStreamPropertyHTTPRequestBytesWrittenCount)) autorelease] unsignedLongLongValue]]; if (totalBytesSent > lastBytesSent) { // We've uploaded more data, reset the timeout @@ -2238,7 +2238,7 @@ - (void)readResponseHeaders NSString *connectionHeader = [[[self responseHeaders] objectForKey:@"Connection"] lowercaseString]; - NSString *httpVersion = NSMakeCollectable([(NSString *)CFHTTPMessageCopyVersion(message) autorelease]); + NSString *httpVersion = [NSMakeCollectable(CFHTTPMessageCopyVersion(message)) autorelease]; // Don't re-use the connection if the server is HTTP 1.0 and didn't send Connection: Keep-Alive if (![httpVersion isEqualToString:(NSString *)kCFHTTPVersion1_0] || [connectionHeader isEqualToString:@"keep-alive"]) { @@ -3385,7 +3385,7 @@ - (void)handleStreamComplete [progressLock lock]; // Find out how much data we've uploaded so far [self setLastBytesSent:totalBytesSent]; - [self setTotalBytesSent:[NSMakeCollectable([(NSNumber *)CFReadStreamCopyProperty((CFReadStreamRef)[self readStream], kCFStreamPropertyHTTPRequestBytesWrittenCount) autorelease]) unsignedLongLongValue]]; + [self setTotalBytesSent:[[NSMakeCollectable(CFReadStreamCopyProperty((CFReadStreamRef)[self readStream], kCFStreamPropertyHTTPRequestBytesWrittenCount)) autorelease] unsignedLongLongValue]]; [self setComplete:YES]; if (![self contentLength]) { [self setContentLength:[self totalBytesRead]]; @@ -3629,7 +3629,7 @@ - (BOOL)retryUsingNewConnection - (void)handleStreamError { - NSError *underlyingError = NSMakeCollectable([(NSError *)CFReadStreamCopyError((CFReadStreamRef)[self readStream]) autorelease]); + NSError *underlyingError = [NSMakeCollectable(CFReadStreamCopyError((CFReadStreamRef)[self readStream])) autorelease]; if (![self error]) { // We may already have handled this error @@ -3807,12 +3807,12 @@ - (BOOL)configureProxies } else { #if TARGET_OS_IPHONE - NSDictionary *proxySettings = NSMakeCollectable([(NSDictionary *)CFNetworkCopySystemProxySettings() autorelease]); + NSDictionary *proxySettings = [NSMakeCollectable(CFNetworkCopySystemProxySettings()) autorelease]; #else - NSDictionary *proxySettings = NSMakeCollectable([(NSDictionary *)SCDynamicStoreCopyProxies(NULL) autorelease]); + NSDictionary *proxySettings = [NSMakeCollectable(SCDynamicStoreCopyProxies(NULL)) autorelease]; #endif - proxies = NSMakeCollectable([(NSArray *)CFNetworkCopyProxiesForURL((CFURLRef)[self url], (CFDictionaryRef)proxySettings) autorelease]); + proxies = [NSMakeCollectable(CFNetworkCopyProxiesForURL((CFURLRef)[self url], (CFDictionaryRef)proxySettings)) autorelease]; // Now check to see if the proxy settings contained a PAC url, we need to run the script to get the real list of proxies if so NSDictionary *settings = [proxies objectAtIndex:0]; @@ -3964,7 +3964,7 @@ - (void)runPACScript:(NSString *)script // Obtain the list of proxies by running the autoconfiguration script CFErrorRef err = NULL; - NSArray *proxies = NSMakeCollectable([(NSArray *)CFNetworkCopyProxiesForAutoConfigurationScript((CFStringRef)script,(CFURLRef)[self url], &err) autorelease]); + NSArray *proxies = [NSMakeCollectable(CFNetworkCopyProxiesForAutoConfigurationScript((CFStringRef)script,(CFURLRef)[self url], &err)) autorelease]; if (!err && [proxies count] > 0) { NSDictionary *settings = [proxies objectAtIndex:0]; [self setProxyHost:[settings objectForKey:(NSString *)kCFProxyHostNameKey]]; @@ -4445,7 +4445,7 @@ + (NSString *)mimeTypeForFileAtPath:(NSString *)path if (!MIMEType) { return @"application/octet-stream"; } - return NSMakeCollectable([(NSString *)MIMEType autorelease]); + return [NSMakeCollectable(MIMEType) autorelease]; } #pragma mark bandwidth measurement / throttling