ios - this class is not key value coding-compliant for the key UserEmailAdresLogin -


back @ again noob question.

for reason following error:

2017-07-25 14:29:00.589401+0200 yiives[1416:534883] *** terminating app due uncaught exception 'nsunknownkeyexception', reason: '[ setvalue:forundefinedkey:]: class not key value coding-compliant key useremailadreslogin.'

now way green see problem on own, please enlighten me.

it not let me load login view. how can make happen :d

i run following code:

import uikit  class loginviewcontroller: uiviewcontroller {      @iboutlet weak var backgroundbutton: uibutton!      @iboutlet weak var useremailadresinput: uitextfield!      @iboutlet weak var userpasswordinput: uitextfield!      @iboutlet weak var userlogin: uibutton!      @iboutlet weak var userforgotpassword: uibutton!       override func viewdidload() {         super.viewdidload()          // additional setup after loading view.     }      override func didreceivememorywarning() {         super.didreceivememorywarning()         // dispose of resources can recreated.     }      @ibaction func closelogin(_ sender: any) {          dismiss(animated: true, completion: nil )     }      @ibaction func login(_ sender: any) {          let useremail = useremailadresinput.text         let userpassword = userpasswordinput.text          let useremailstored = userdefaults.standard.string(forkey: "useremail");          let userpasswordstored = userdefaults.standard.string(forkey: "userpassword");          if(useremailstored == useremail){             if(userpasswordstored == userpassword){                  //login succesfull                  userdefaults.standard.set(true, forkey: "userloggedin")                 userdefaults.standard.synchronize();              }           }     }  }   if need source data bein inserted:  import uikit  class entryviewcontroller: uiviewcontroller, uitextfielddelegate {      @iboutlet weak var useremailadresinput: uitextfield!      @iboutlet weak var userpasswordinput: uitextfield!      @iboutlet weak var userpasswordinputrepeated: uitextfield!      @iboutlet weak var usersignup: uibutton!      override func viewdidload() {         super.viewdidload()          self.useremailadresinput.delegate = self         self.userpasswordinput.delegate = self         self.userpasswordinputrepeated.delegate = self       }      override func didreceivememorywarning() {         super.didreceivememorywarning()         // dispose of resources can recreated.     }      //hide keyboard upon touch      override func touchesbegan(_ touches: set<uitouch>, event: uievent?){         self.view.endediting(true)     }      //hide keyboard upon return key     func textfieldshouldreturn(_ textfield: uitextfield) -> bool {         if textfield == useremailadresinput{             useremailadresinput.resignfirstresponder()         } else if textfield == userpasswordinput{             userpasswordinput.resignfirstresponder()         } else {             userpasswordinputrepeated.resignfirstresponder()         }         return true     }      @ibaction func signup(_ sender: any) {          let useremail = useremailadresinput.text;         let userpassword = userpasswordinput.text;         let userpasswordrepeated = userpasswordinputrepeated.text;            //check if fields filled in correctly          if(useremail?.isempty == true || userpassword?.isempty == true || userpasswordrepeated?.isempty == true){              displayalertmessage(usermessage: "alle velden moeten ingevuld worden");             return;         }          if useremail?.range(of: "@") == nil{             displayalertmessage(usermessage: "vul een legitiem emailadres in");             return;         }          if (userpassword?.characters.count)! < 5{             displayalertmessage(usermessage: "wachtwoord moet langer zijn dan 5 karakters");         }          if(userpassword != userpasswordrepeated){              displayalertmessage(usermessage: "wachtwoorden zijn niet gelijk");             return;         }          //store data         userdefaults.standard.set(useremail, forkey: "useremail");         userdefaults.standard.set(userpassword, forkey: "userpassword");         userdefaults.standard.synchronize();          //signup succesfull         var alert = uialertcontroller(title:"succesvol aangemeld!", message: "ga naar je email inbox om je aanmelding te voltooien", preferredstyle: uialertcontrollerstyle.alert);          let okaction = uialertaction(title:"ok", style: uialertactionstyle.default, handler: nil);          alert.addaction(okaction);         self.present(alert, animated: true, completion: nil)       }      func displayalertmessage(usermessage:string){          var alert = uialertcontroller(title:"melding", message: usermessage, preferredstyle: uialertcontrollerstyle.alert);          let okaction = uialertaction(title:"ok", style: uialertactionstyle.default, handler: nil);          alert.addaction(okaction);          self.present(alert, animated: true, completion: nil)      }  } 

this error means have link (i think in storyboard file) variable called useremailadreslogin variable no longer exists in code source. check it, right click on controller in storyboard, display list of links, , delete clicking on cross.

if probleme not in storyboard, it's typo in variable name (by way should written : "address").


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -