今天我已經將我的項目從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