swift - error with Int function in Xcode 7 beta -


this question has answer here:

i have error while testing code in xcode 7 beta, error between 2 asterisk

class viewcontroller: uiviewcontroller {

@iboutlet weak var agee: uitextfield! @iboutlet weak var labelage: uilabel! @ibaction func findage(sender: anyobject) {       *var enteredage = agee!.text.toint()*      if enteredage != nil {          var catyears = enteredage! * 7          labelage.text = "your cat \(catyears) in cat years"      } else {          labelage.text = "please enter number in box"      }   } 

@iboutlet var agee: uitextfield! @iboutlet var labelage: uilabel! @ibaction func findage(sender: anyobject) {      if agee != nil {      var enteredage = agee.text.toint()     var catyears = enteredage! * 7      labelage.text = "your cat age \(catyears) in cat years"     print(catyears) // check in logs     }     else {         labelage.text = "please enter number in box"     }  } 

just paste above code in project.

don't forget connect @iboutlets , @ibaction again[ctrl+drag] in assistant editor. otherwise you'll stuck in signal issue(sigabrt) hope helps!


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -