2

I'm trying to setup a timer in Xcode 9 using Swift 4 and I have a function called: hello.

So in the timer code, I added #selector(hello()) like I would before, but this time it would continue to crash and make me add @objc in front of the hello function. Does anyone know what that means? Thanks!

Hamish
  • 78,605
  • 19
  • 187
  • 280
Amit Kalra
  • 4,085
  • 6
  • 28
  • 44
  • Please check [this thread](https://stackoverflow.com/q/44379348/6541007) or [this](https://stackoverflow.com/q/44390378/6541007). – OOPer Jul 22 '17 at 08:24

1 Answers1

2

When you use the selector expression #selector and pass in a function without parameters you'll need to call it like that #selector(hello)

Or Ron
  • 2,313
  • 20
  • 34