SHARE
TWEET

Untitled




Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- NSURL *URL = [NSURL URLWithString:sourceUrl];
- NSError *error=[[[NSError alloc]init] autorelease];
- NSData* theData = [NSData dataWithContentsOfURL: URL]; // Line One to download
- NSURLResponse *response1 = nil;
- NSURLRequest *theRequest =[[NSURLRequest requestWithURL:URL cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60] autorelease];
- NSData* theData1 = [NSURLConnection sendSynchronousRequest:theRequest returningResponse:&response1 error:&error]; // Line two to download
- if(error != nil)
- {
- NSString *errorIdentifier = [NSString stringWithFormat:@"(%@)[%d]",error.domain,error.code];
- }
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.