Download Image from URL


/ Published in: Objective C
Save to your folder(s)



Copy this code and paste it in your HTML
  1. - (UIImage *) getImageFromURL: (NSString *)theURL {
  2. UIImage *theImage = NULL;
  3. NSString *imageFileName = [BT_strings getFileNameFromURL:theURL];
  4. NSData *imageData = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:theURL]];
  5. theImage = [[UIImage alloc] initWithData:imageData];
  6. [BT_fileManager saveImageToFile:theImage fileName:imageFileName];
  7. return theImage;
  8. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.