xcode - Swift 2 fatal error: unexpectedly found nil while unwrapping an Optional value -
error found line: self.picture.image = uiimage(named: pictures[closestbeacon.minor.integervalue]!)
how solve?
you can prevent crash safely unwrapping pictures[closetbeacon.minor.integervalue] if let statement.
if let myimage = pictures[closetbeacon.minor.integervalue] { self.picture.image = uiimage(named: myimage)
}
Comments
Post a Comment