title: Store and update a Swift Dictionary in NSUserDefaults Xcode
body: <p>I would like to store and update a Dictionary when a user enters a value. Everything seems to function until this code, and the application crashes:</p>
  
  <pre><code>override func viewDidLoad() {
      super.viewDidLoad()
  
      if NSUserDefaults.standardUserDefaults().objectForKey("dict") != nil  {
          answersSaved = NSUserDefaults.standardUserDefaults().objectForKey("dict") as [String:String]
      }
  }
  </code></pre>
  
  <p>The error message says "anyObject is not convertible to [String:String]. It offers to add ! after the as but then the app crashes.</p>
  
  <p>dict is my Dictionary variable with Strings as values.</p>
  
  <p>I also have code updating the NSUserDefaults but it appears to be functioning.</p>
  
  <p>Thanks so much in advance!</p>