swift - Using variable as NSTimer intervals -
when try use integer variable timer interval in nstimer in swift " argument "selector in call" code :
var count = 3 var timer = nstimer() @ibaction func playbuttonpressed(sender: anyobject) { timer = nstimer.scheduledtimerwithtimeinterval(count, target: self, selector: selector("result"),userinfo: nil, repeats: true) }
if put 3 instead of count works want able give user advantage set interval himself.
the nstimer.scheduledtimerwithtimeinterval takes double first parameter. try using:
var count: double = 3.0
Comments
Post a Comment