I've made this little app "How many fingers" where the user has to guess how many fingers the computer is holding behind it's back. Now I want it to be able to save the users score with NSUserdefaults, but it's not working. Here is how my code looks right now:

```
//
//  ViewController.swift
//  How many Fingers?
//
//  Created by Kevin Nguyen on 02.05.15.
//  Copyright (c) 2015 Kevin Nguyen. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    @IBOutlet var userGuess: UITextField!
    @IBOutlet var userScore: UILabel!
    @IBOutlet var userTotal: UILabel!
    @IBOutlet var result: UILabel!
    var score:Int = 0
    var totalGames:Int = 0

    @IBAction func resetScore(sender: AnyObject) {
        score = 0
        userScore.text = "0"
    }

    @IBAction func start(sender: AnyObject) {
        var userGuessInt = userGuess.text.toInt()
        var fingers = Int(arc4random_uniform(6))
        if userGuessInt <= 5 {
            if userGuessInt == fingers {
                result.text = "Great! You were right!"
                score++
                totalGames++
                userScore.text = "\(score)"
                userTotal.text = "\(totalGames)"
                println("User score is \(score); total games is \(totalGames)")
                NSUserDefaults.standardUserDefaults().setObject(score, forKey: "svScore")
                NSUserDefaults.standardUserDefaults().setObject(totalGames, forKey: "svTotalGames")
            } else {
                result.text = "Try Again!"
                println("User score is \(score); total games is \(totalGames)")
                totalGames++
                userTotal.text = "\(totalGames)"
                NSUserDefaults.standardUserDefaults().setObject(score, forKey: "svScore")
                NSUserDefaults.standardUserDefaults().setObject(totalGames, forKey: "svTotalGames")
            }

        } else{
            result.text = "Enter a number from 0 up to 5!"
        }
    }

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
        if score != 0 {
            var score:Int = NSUserDefaults.standardUserDefaults().objectForKey("svScore")! as! Int
            userScore.text = "\(score)"
        }
        if totalGames != 0 {
            var totalGames:Int = NSUserDefaults.standardUserDefaults().objectForKey("svTotalGames")! as! Int
            userTotal.text = "\(totalGames)"
        }
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

}

```