title: Cannot stop NSTimer
body: <p>I know have many question like that on stackoverflow but with me. I still cannot stop my NSTimer. Below is my code:</p>
  
  <pre><code>func setupTimerForRecord(){
      dispatch_async(dispatch_get_main_queue(), { () -&gt; Void in
          var timer = NSTimer.scheduledTimerWithTimeInterval(1.0, target: self, selector: Selector("timeStick:"), userInfo: nil, repeats: true)
      })
  }
  </code></pre>
  
  <p>and function stop:</p>
  
  <pre><code>func resetTimmerLabel(){
      dispatch_async(dispatch_get_main_queue(), { () -&gt; Void in
          self.timer?.invalidate()
          self.timer = nil
          self.timeMin = 0
          self.timeSec = 0
          var timeString = String(format: "%02d:%02d", arguments: [self.timeMin, self.timeSec])
          self.lblTimer.text = timeString
      })
  }
  </code></pre>
  
  <p>function selector:</p>
  
  <pre><code>func timeStick(timer: NSTimer){
      print("timeStick")
      self.timeSec++
      if self.timeSec == 60{
          self.timeSec = 0
          self.timeMin++
      }
      var timeString = String(format: "%02d:%02d", arguments: [self.timeMin, self.timeSec])
      lblTimer.text = timeString
  }
  </code></pre>
  
  <p>call <strong>setupTimerForRecord</strong> at button clicked. and <strong>resetTimmerLabel</strong> at <strong>viewWillDisappear</strong> but the function <strong>timeStick</strong> still run. Please help me</p>
  
  <p><strong>Edit</strong> SORRY for my stupid mistake. The problem is I create another new one timer var timer. It must self.timer into the function <strong>setupTimerForRecord</strong></p>