Guest User

Untitled

a guest
Jan 18th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. NSURL *URL = [NSURL URLWithString:sourceUrl];
  2. NSError *error=[[[NSError alloc]init] autorelease];
  3.  
  4.  
  5. NSData* theData = [NSData dataWithContentsOfURL: URL]; // Line One to download
  6. NSURLResponse *response1 = nil;
  7. NSURLRequest *theRequest =[[NSURLRequest requestWithURL:URL cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60] autorelease];
  8. NSData* theData1 = [NSURLConnection sendSynchronousRequest:theRequest returningResponse:&response1 error:&error]; // Line two to download
  9.  
  10. if(error != nil)
  11. {
  12. NSString *errorIdentifier = [NSString stringWithFormat:@"(%@)[%d]",error.domain,error.code];
  13. }
Add Comment
Please, Sign In to add comment