Unrecognized selector sent to instance NSTimer Swift

后端 未结 3 1673
轮回少年
轮回少年 2021-01-05 08:35

I\'m trying to developing an app that includes a simple Stopwatch feature. I\'m using Xcode 6 and the Swift language. Here is the code in FirstViewController



        
3条回答
  •  佛祖请我去吃肉
    2021-01-05 09:18

    Another possibility: make sure your selector function doesn't throw, as that will also give you an unrecognized selector exception:

    func mySelector(timer: NSTimer) throws {
    }
    

提交回复
热议问题