Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)downloadAtURLString:(NSString *)urlString
- {
- NSMutableData *data = [[NSMutableData alloc] init];
- self.activeDownload = data;
- [data release];
- // encode the urlString with percent escapes
- NSString *urlStr = [urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
- NSURL *url = [[NSURL alloc] initWithString:urlStr];
- NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url];
- NSURLConnection *conn = [[NSURLConnection alloc] initWithRequest:request delegate:self];
- self.urlConnection = conn;
- [conn release], [request release], [url release];
- }
- NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:urlString] cachePolicy:NSURLRequestReturnCacheDataElseLoad timeoutInterval:30.0];
- - (void)downloadAtURLString:(NSString *)urlString
- {
- NSMutableData *data = [[NSMutableData alloc] init];
- self.activeDownload = data;
- [data release];
- // encode the urlString with percent escapes
- NSString *urlStr = [urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
- NSURL *url = [[NSURL alloc] initWithString:urlStr];
- NSURLRequest *request = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:30.0];
- NSURLConnection *conn = [[NSURLConnection alloc] initWithRequest:request delegate:self];
- self.urlConnection = conn;
- [conn release], [request release], [url release];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement