I'm trying to send data through URL but some data at all time is not have value because the user doesn't change it so I give it empty string.
if the user not change it but when I'm executing code I put breakpoints at each important line and the error "unexpectedly found nil while unwrapping an Optional value"
appears in this line
let postData:NSData = post.data(using: String.Encoding.ascii.rawValue)! as NSData
post like this:
username=myusername&password=&tel=&email=myemail&address=&DOB=choose&cinsiyet=2&changedPass=false
Tel,password and address doesn't have value(or it's empty string) because the user doesn't change it.
The encoding of String can affect in this case or what because all not changed textfield have "" ( empty String ) and I'm sure from that.