I am trying to use this solution: load-image-from-url-on-watchkit
I have a table on the clock in which I try to load images in each row. I run this code and then update the text fields of the table. Without trying to get images, all text loads correctly.
But when I add this code:
let site = "myurl.com/image.jpeg"
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) {
let url:NSURL = NSURL(string:site)!
var data:NSData = NSData(contentsOfURL: url)!
var placeholder = UIImage(data: data)!
dispatch_async(dispatch_get_main_queue()) {
row.myRowImage.setImage(placeholder)
}
}
I get the error: fatal error: zero unexpectedly found while deploying optional value
And I canβt understand what can cause this if it is loaded correctly and other parts of the table are loaded correctly. Any help is much appreciated!
source
share