Given a piece of code like this:
func downloadImage() {
// if image is not downloaded yet, get it
// 1
if (post?.image.value == nil) {
// 2
post?.imageFile!.getDataInBackgroundWithBlock { (data: NSData?, error: NSError?) -> Void in
if let data = data {
let image = UIImage(data: data, scale:1.0)!
// 3
self.post!.image.value = image
}
}
}
}
What is the difference if I turned post from ? to !
Also, how come when I try and do ! I get a:
EXC_BAD_INSTRUCTION, but when I use ? I do not get the error but the screen I am trying to load does not load till a refresh?
Ideas?