0
私は迅速にコードすることを学んでいます。 私は、例外がスローされないも任意の画像がロードされる次のコードURLからイメージセルに画像をロード
import Cocoa
class ViewController: NSViewController {
@IBOutlet weak var well: NSImageCell!
@IBAction func clickme(_ sender: Any) {
let image = NSImage(byReferencing:NSURL(string: "http://imgsv.imaging.nikon.com/lineup/lens/zoom/normalzoom/af-s_dx_18-140mmf_35-56g_ed_vr/img/sample/sample1_l.jpg")! as URL)
well.image=image;
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
override var representedObject: Any? {
didSet {
// Update the view, if already loaded.
}
}
}
を使用して画像well.I'm内に配置された画像のセルにイメージをロードしようとしています。 私は間違っているのですか?
[App Transport Security]の設定で任意の負荷を許可しましたか? – the4kman
@ the4kmanいいえ...うーん..それは何ですか? :) – techno
[この質問](https://stackoverflow.com/questions/31254725/transport-security-has-blocked-a-cleartext-http)を見てください。 – the4kman