title: NSUserDefaults to Save int - Simple fix
body: <p>The error I am getting is <code>cannot invoke '&gt;' with an argument list of type '(() -&gt; (), Int)'</code></p>
  
  <p>The code works if <code>var score = 0</code> is inside the score function.</p>
  
  <p>Where exactly should I store this function for this to work, I am planning to make a button and when it is clicked the <code>myScore</code> label text is changed to <code>String(score)</code>so it will display on the score. I'm new to NSUserDefaults so go easy :) </p>
  
  <pre><code>import UIKit
  
  var score = 0
  
  class ViewController: UIViewController {
  
  @IBOutlet weak var myScore: UILabel!
  
  override func viewDidLoad() {
      super.viewDidLoad()
      // Do any additional setup after loading the view, typically from a nib.
  }
  
  func score() {
      NSUserDefaults.standardUserDefaults().integerForKey("highscore")
  
      //Check if score is higher than NSUserDefaults stored value and change NSUserDefaults stored value if it's true
      if score &gt; NSUserDefaults.standardUserDefaults().integerForKey("highscore") {
          NSUserDefaults.standardUserDefaults().setInteger(score, forKey: "highscore")
          NSUserDefaults.standardUserDefaults().synchronize()
      }
  
      NSUserDefaults.standardUserDefaults().integerForKey("highscore")
  
  }
  override func didReceiveMemoryWarning() {
      super.didReceiveMemoryWarning()
      // Dispose of any resources that can be recreated.
  }
  
  
  }
  </code></pre>