I have 2 image URLs and 2 image URLs show image when i add them to browser. I have a error when i get image from URL and put it to array.
Case1: I use stringURL1, and OK
Case2: I use stringURL2, and then, as you see, it crashed!
MyCode:
- (void)viewDidLoad {
[super viewDidLoad];
NSString* stringURL1 = @"https://www.wonderplugin.com/wp-content/uploads/2014/06/wordpress-lightbox-gallery.png";
NSString* stringURL2 = @"http://cdn3.vox-cdn.com/uploads/chorus_asset/file/917470/iphone-6-travel-photo-review-mann-header.0.jpg";
NSURL *url = [NSURL URLWithString:stringURL1];
NSData* imageData = [[NSData alloc]initWithContentsOfURL:url];
UIImage* image = [[UIImage alloc] initWithData:imageData];
NSArray *arrayData = @[@"1", @"2", image];
NSLog(@"%@",arrayData);
}
Can you explain for me about this error, please?