daily pastebin goal
4%
SHARE
TWEET

Untitled

a guest Feb 22nd, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. - (void)downloadAtURLString:(NSString *)urlString
  2. {
  3.     NSMutableData *data = [[NSMutableData alloc] init];
  4.     self.activeDownload = data;
  5.     [data release];
  6.     // encode the urlString with percent escapes
  7.     NSString *urlStr = [urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
  8.     NSURL *url = [[NSURL alloc] initWithString:urlStr];
  9.     NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url];
  10.     NSURLConnection *conn = [[NSURLConnection alloc] initWithRequest:request delegate:self];
  11.     self.urlConnection = conn;
  12.     [conn release], [request release], [url release];
  13.  }
  14.    
  15. NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:urlString] cachePolicy:NSURLRequestReturnCacheDataElseLoad timeoutInterval:30.0];
  16.    
  17. - (void)downloadAtURLString:(NSString *)urlString
  18. {
  19.     NSMutableData *data = [[NSMutableData alloc] init];
  20.     self.activeDownload = data;
  21.     [data release];
  22.     // encode the urlString with percent escapes
  23.     NSString *urlStr = [urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
  24.     NSURL *url = [[NSURL alloc] initWithString:urlStr];
  25.     NSURLRequest *request = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:30.0];
  26.     NSURLConnection *conn = [[NSURLConnection alloc] initWithRequest:request delegate:self];
  27.     self.urlConnection = conn;
  28.     [conn release], [request release], [url release];
  29.  }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top