无法在后台停止计时器

时间:2016-03-09 20:07:41

标签: ios swift nstimer

我在timer = NSTimer.scheduledTimerWithTimeInterval(3.0, target: self, selector: "get", userInfo: nil, repeats: true) FirstVCvar timer: NSTimer?课外(我的意思是全球宣布)。

然后我希望timer?.invalidate()中的applicationDidEnterBackgroundapplicationWillResignActive中的AppDelegate来电,但它不起作用。

我做错了什么?

0 个答案:

没有答案