Problema con swift login tramite json

Ciao a tutti,
sto creando un’applicazione per iOS con login e register. Mentre il register funziona alla perfezione, attraverso una pagina php che si connette al database, con il login ho alcuni problemi.
Sostanzialmente il codice è questo:

    if (!userEmail.isEmpty && !userPassword.isEmpty){
            let myUrl = NSURL(string: "http://ilmiosito/login.php")
            let request = NSMutableURLRequest(URL: myUrl!)
            
            request.HTTPMethod = "POST";
            
            let postString = "email=\(userEmail)&password=\(userPassword)"
            request.HTTPBody = postString.dataUsingEncoding(NSUTF8StringEncoding)
       NSURLConnection.sendAsynchronousRequest(request, queue: NSOperationQueue.mainQueue())
                {
                   (response, data, error) in
        
                if error != nil {
                    println("error = \(error)")
                    return
                }
                var err: NSError?
                var json = NSJSONSerialization.JSONObjectWithData(data,options: .MutableContainers, error: &err) as? NSDictionary
            
            if let parseJSON = json {
                var resultValue = parseJSON["status"] as? String
                println("result: \(resultValue)")
                if (resultValue=="success"){
                    NSUserDefaults.standardUserDefaults().setBool(true,forKey:"isUserLoggedIn")
                    NSUserDefaults.standardUserDefaults().synchronize()
                    self.dismissViewControllerAnimated(true, completion:nil)
                    self.performSegueWithIdentifier("home", sender: self)
                }
                    else {
                    self.displayAlertMessage("Dati errati o utente inesistente.")
                    }
                }
            }
        } else {
            self.displayAlertMessage("Perfavore compila tutti i campi.") }
    }

Il problema è che quando i dati sono errati funziona tutto ed esce il messaggio “Dati errati o utente inesistente.”, mentre quando i dati inseriti sono corretti l’applicazione si ferma a:

                var resultValue = parseJSON["status"] as? String

(l’ho dedotto utilizzando i breakpoints)

Qualcuno può aiutarmi? :smiley: Sono uno studente liceale e sto studiando programmazione per conto mio, sono ancora ai primi passi…
Grazie a tutti in anticipo