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

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -