I have view that displays an image in the background. The image is picked from an array of images and I am using a random function to pick them. On doing so the app crashes but ONLY on an iPhone 5/5S.
Here is my code: ...
//Images
let rest28 = UIImage(named: "rest28")
let rest29 = UIImage(named: "rest29")
let rest30 = UIImage(named: "rest30")
// image Array
imageArray = [rest1!, rest3!, rest4!, rest5!, rest6!, rest7!, rest8!, rest9!,
rest10!, rest11!, rest12!, rest13!, rest15!, rest17!, rest18!, rest21!, rest22!, rest24!, rest25!, rest26!, rest27!, rest28!, rest29!, rest30!]
// Picking a number in the array of images.
let randomImageSelection = 0 + Int(arc4random()) % (0 - imageArray.count - 1)
backgroundImage.image = imageArray[randomImageSelection]
This is the crash I get on the randomImageSelection function:
- Failed to set (isHomeScreenImage) user defined inspected property on (UIView): [ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key isHomeScreenImage.
Thanks for the help in advance. :)