EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) on Swift

var gamearea: CGRect    

 

override init(size: CGSize)

 

{     

 

let maxaspectratio: CGFloat=16.0/9.0  

let playablewidth = size.height / maxaspectratio 

let margin = (size.width – playablewidth) / 2.0  

gamearea = CGRect(x: margin, y: 0, width: playablewidth, height: size.height)     

super.init(size: size) 

 

}      

 

required init?(coder aDecoder: NSCoder) {         fatalError(“init(coder:) has not been implemented”)    ——> i have got error stay here ( EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)     }



pls some body help me!

Powered by WPeMatico

About

You may also like...

Comments are closed.