今天我已经将我的项目从XCode 6移到了XCode 7上。在它完美工作之前,我现在遇到了一些奇怪的问题。UIImageView网页图像不会显示在XCode 7上
我在UIImageView上显示图像,该图像是从网上下载的。下面是代码:
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0ul);
dispatch_async(queue, ^{
NSData *data = [NSData dataWithContentsOfURL:imageURL];
UIImage *image = [UIImage imageWithData:data];
dispatch_async(dispatch_get_main_queue(), ^{
[cell.imgTrainer setImage:image];
selectedTrainerImage = image;
});
});
我已经检查imageURL
,这是罚款。
我与presentViewController
UIStoryboard* storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
UIViewController* controller = [storyboard instantiateViewControllerWithIdentifier:@"TrainerListView"];
self.animationController = [[ZoomAnimationController alloc] init];
controller.transitioningDelegate = self;
[self presentViewController:controller animated:YES completion:nil];
调用的页面我不明白是什么问题。我没有碰连系了什么工作的XCode 6
它是HTTPS?可能是因为App Transport Security(https://developer.apple.com/library/prerelease/ios/technotes/App-Transport-Security-Technote/) –
这是另一个很好的例子,为什么不使用'WithContentsOfURL:'方法。使用'NSURLSession'是因为没有办法检测'WithContentsOfURL:' – rckoenes