var Timer = NSTimer.scheduledTimerWithTimeInterval(0.1, target: self, selector: Selector("SpawnBullets"), userInfo: nil, repeats: true)
在此之后,它告诉我变量'计时器'从未使用过,我该怎么办? 请帮忙
答案 0 :(得分:3)
如果您稍后不使用变量Timer,只需使用
NSTimer.scheduledTimerWithTimeInterval(0.1, target: self, selector: Selector("SpawnBullets"), userInfo: nil, repeats: true)
或
_ = NSTimer.scheduledTimerWithTimeInterval(0.1, target: self, selector: Selector("SpawnBullets"), userInfo: nil, repeats: true)