0

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 ) 
0

2 Answers 2

1

Use this instead

var timer = NSTimer.scheduledTimerWithTimeInterval ( 1, target: self, selector: "result", userInfo: nil, repeats: true ) 
Sign up to request clarification or add additional context in comments.

Comments

0

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() { } 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.