title: UserDefault in Xamarin
body: <p>I am trying to assign textfield entries just right before SettingViewController dismissed, and checking them while URLViewController appears.</p>
  
  <p>However, once I check it returns null even though user entered all required information;</p>
  
  <p>//SettingViewController</p>
  
  <pre><code>partial class SettingViewController : UIViewController
      {
          public ServerSettings sSettings;
          public SettingViewController (IntPtr handle) : base (handle)
          {
              this.Title = "Settings";
              this.sSettings = new ServerSettings();
  
          }
  
          public override void ViewWillDisappear (bool animated)
          {
              sSettings.server=serverTF.Text;
              sSettings.port = portTF.Text;
              sSettings.password = passwordTF.Text;
              sSettings.userid = inboxuserTF.Text;
              sSettings.username = usernameTF.Text;
          }
      }
  </code></pre>
  
  <p>//URLViewController</p>
  
  <pre><code>public override void ViewWillAppear(bool animated)
          {
          base.ViewWillAppear (animated);
          SettingViewController callSetting = this.Storyboard.InstantiateViewController ("SettingViewController") as SettingViewController;
  
          if (callSetting == null)
              throw new Exception("callSetting is null"); // Or if you can handle having a null callSetting then correct for it, but realistically this is a problem, so I'd throw an Exception
  
          if (callSetting.sSettings == null)
              throw new Exception("sSetting is null"); // Or if you can handle having a null callSetting.sSetting then correct it (such as using a default value).
  
          if (string.IsNullOrEmpty(callSetting.sSettings.password)==true) 
              Console.WriteLine("is null or empty");
          else 
              Console.WriteLine (callSetting.sSettings.password);
  
      }
  </code></pre>
  
  <p>Even though user fullfill all the textfield entries, it returns null.
  //SettingsViewController
  <img src="https://i.stack.imgur.com/l222P.png" alt="enter image description here"></p>
  
  <p>//URLViewController
  <img src="https://i.stack.imgur.com/wpRNG.png" alt="enter image description here"></p>