title: NSUserDefaults - Xamarin
body: <p>I'm just trying to save / restore a couple doubles.  What I'm seeing is that it works while attached to debugger, but after 15 minutes of the app being closed - relaunch app and it restores "-180" for both doubles.   </p>
  
  <p>Does this look right?  Or you think I'm saving "-180" somehow?</p>
  
  <p>This is with device not simulator.  i'm using <code>Map.DidUpdateUserLocation</code> which gives <code>MKUserLocationEventArgs</code>.<br><br>Somehow it gives -180,-180 for position.  Possible Xamarin bug?</p>
  
  <pre><code>    private CLLocationCoordinate2D GetLastLocation()
      {
          var user = NSUserDefaults.StandardUserDefaults;
  
          double lat = user.DoubleForKey ("LastPositionLat");
          double lng = user.DoubleForKey ("LastPositionLng");
  
          var location = new CLLocationCoordinate2D (lat, lng);
          return location;
      }
  
      private void SaveLastLocation(CLLocationCoordinate2D coord)
      {
          var user = NSUserDefaults.StandardUserDefaults;
          user.SetDouble (coord.Latitude, "LastPositionLat");
          user.SetDouble (coord.Longitude, "LastPositionLng");
          user.Synchronize ();
      }
  </code></pre>