why NSTimer works just once in swift
<p>I have a http request, and if I receive the response correctly, then I want to start a timer that fires a function each second. That function is also a http request.</p>

<p>this is my code to fire the timer</p>

<pre><code>    if let data = data {
        do{
            let resultJSON = try NSJSONSerialization.JSONObjectWithData(data, options: [])
            requestClient.id = resultJSON["id"] as! Double
            self.timerResponse = NSTimer.scheduledTimerWithTimeInterval(1, target: self, selector: "checkIfThereAreResponeses", userInfo: nil, repeats: true)
            self.timerResponse!.fire()
        }catch{
        }
    }
</code></pre>

<p>as you see, I'm calling a function called <code>checkIfThereAreResponses</code></p>

<p>In that function, i have a print statement, and that print statement is being printed just once, <strong>though my timer supposed to work each 1 second</strong></p>

<p>what missing i have?</p>

<p>And this is the function </p>

<pre><code> func checkIfThereAreResponeses(){
    if (requestClient!.id != nil) {
        let url = NSURL(string: "http://localhost:blablabla")
        let request = NSMutableURLRequest(URL: url)
        request.HTTPMethod = "POST"

        let session = NSURLSession.sharedSession()

        task = session.dataTaskWithRequest(request, completionHandler: {(data, response, error) in
            if let error = error {
                print("error = \(error)")
            }



            if let data = data {
                do {
                    let resultJSONArray = try NSJSONSerialization.JSONObjectWithData(data, options: []) as! NSArray
        bla bla bla

                }catch {
                    print("no responses yet = \(error)")
                }
            }
        })
        task!.resume()
    }else {
        print("not yet ")
    }
}
</code></pre>

<p>the print that i receive <strong>JUST ONCE</strong> is the <code>no response yet</code></p>