I cannot get a timer to work in Swift please help. I get the error extra 'selector' in call
.
var timer = NSTimer.scheduledTimerWithTimeInterval(
1,
target: self,
selector: Selector ("result"),
userInfo: nil,
repeats: true
)
I cannot get a timer to work in Swift please help. I get the error extra 'selector' in call
.
var timer = NSTimer.scheduledTimerWithTimeInterval(
1,
target: self,
selector: Selector ("result"),
userInfo: nil,
repeats: true
)
Use this instead
var timer = NSTimer.scheduledTimerWithTimeInterval (
1,
target: self,
selector: "result",
userInfo: nil,
repeats: true
)
One from a method I wrote:
override func viewDidLoad() {
super.viewDidLoad()
let aSelector : Selector = "updateTime"
let timer = NSTimer.scheduledTimerWithTimeInterval(1, target: self, selector: aSelector, userInfo: nil, repeats: true)
}
func updateTime() {
}