mercredi 25 janvier 2017

unkown error in arc4random_uniform()

These lines were working with me for 3 days, suddenly it made an error and xcode generated a breakpoint.

The breakpoint appears beside randonTop variable.

Error called bad instruction.

here is my code:

let top = self.frame.maxY
        let bottom = self.frame.minY
        let right = self.frame.maxX
        let left = self.frame.minX
        // getting position
        var position: CGPoint!
        switch edge {
        case "top":
            let randomTop = arc4random_uniform(UInt32((right - left) + 1) + UInt32(left))
            position = CGPoint(x: CGFloat(randomTop), y: top + (globalRadius + (globalRadius * 0.5)))
            break

help please.




Aucun commentaire:

Enregistrer un commentaire