fatal error: unexpectedly found nil while unwrapping an Optional value
我有上述错误,我正试图破解解决方案。
@IBOutlet var imageView: UIImageView?
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
let url = NSURL(fileURLWithPath: "https://upload.wikimedia.org/wikipedia/commons/thumb/c/c2/Faust_bei_der_Arbeit.JPG/220px-Faust_bei_der_Arbeit.JPG");
let imageData: NSData? = NSData(contentsOfURL: url)
let image = UIImage(data: imageData!)
imageView?.image = image
}