title: Write and Read a plist in swift with simple data
body: <p>i'm trying to understand how to save a simple value, an integer, in a plist.
  but i'm finding on the net only solution for save dictionary and array and i don't understand what i can change to work it only for an integer.
  this is the code for the moment...</p>
  
  <pre><code>var musicalChoice = 1
  var musicString : String = "5"
  
  override func viewDidLoad() {
      super.viewDidLoad()
      musicString = String(musicalChoice)}
  
  
  override func didReceiveMemoryWarning() {
      super.didReceiveMemoryWarning()
      // Dispose of any resources that can be recreated.
  }
  
  func writePlist() {
      let paths = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true) as NSArray
      let documentsDirectory = paths.objectAtIndex(0) as NSString
      let path = documentsDirectory.stringByAppendingPathComponent("Preferences.plist")
      musicString.writeToFile(path, atomically: true, encoding: NSUTF8StringEncoding, error:nil )
  }
  
  func readPlist() {
  
  }
  </code></pre>