title: User Defaults Attempt to set a non-property-list object
body: <p>I've got a problem with storing an NSDictionary object with 39 parameters (key and value) into a UserDefault object. The code crashes where I left the comment. self.userDefaults.set(data, forKey: "userData")</p>
  
  <p>This is the error I'm getting:</p>
  
  <pre><code>[User Defaults] Attempt to set a non-property-list object {
  city = "";
  country = "";
  cover = "default.png";
  date = "2019-10-02";
  description = "";
  email = "hashdoge@outlook.com";
  "email_comment" = 0;
  "email_like" = 0;
  "email_new_friend" = 0;
  "email_newsletter" = 1;
  facebook = "";
  "first_name" = "";
  follower = 3;
  following = 2;
  gender = 0;
  gplus = "";
  idu = 42;
  image = "default.png";
  ip = "";
  "last_name" = "";
  lastfm = "";
  likes = 3;
  "login_token" = "&lt;null&gt;";
  "logout_time" = 0;
  myspace = "";
  notificationc = 1;
  notificationd = 1;
  notificationf = 1;
  notificationl = 1;
  offline = 0;
  online = 1570879800;
  password = "$2y$107675ze1wZ/riJgQ2e";
  private = 0;
  salted = "$2y$10$GKUmSJGcq932DMJGMA8791RIO";
  soundcloud = "";
  suspended = 0;
  totaltracks = 0;
  tumblr = "";
  twitter = "";
  username = HashDoge;
  vimeo = "";
  website = "";
  youtube = "";} as an NSUserDefaults/CFPreferences value for key userData
  </code></pre>
  
  <p>Here is the code that I'm trying to make work
  Code:</p>
  
  <pre><code>func callApigetLoginResponse(){
      FTIndicator.showProgressWithmessage("", userInteractionEnable: false)
      let parameters = ["useremail":txtEmail.text!,"password":txtPassword.text!]
      SignInGet.ApiGetSignIn(parameters: parameters as NSDictionary) { (Result, Error) in
         // print(Result!)
          if Error != nil{
              print(Error!)
          }else{
              let dataDict:NSDictionary = Result as! NSDictionary
              if (dataDict["success"]as! Int == 1){
                 let  loginResponse = dataDict["userlogin"] as! NSArray
                  let data = loginResponse[0] as! NSDictionary
                  let uid = data["idu"] as! String
                  self.sendTokenaApi(uid: uid)
                  self.userDefaults.set(uid, forKey: "id")
                  self.userDefaults.set(data, forKey: "userData") // code crashes here
                  self.userDefaults.synchronize()
                  let updateUserInfo = UpdateUserInfoUtl()
                  updateUserInfo.callApigetUserDataResponse()
                  self.pushToHomeController()
              }else if (dataDict["success"]as! Int == 0) {
               let  message = dataDict["userlogin"] as! String
                  FTIndicator.showInfo(withMessage: message)
              }
              }
          }
      }
  </code></pre>