I have an app that has to send a string from one viewcontroller
to another. I am using prepareforsegue
which works fine i can print the var out on the other viewcontroller in a UILabel
.
But now I am trying to send it to my php script which communicates with my database. The problem is I am receiving the var that is being send over as var helpCode:string?
Then the function runs which is NSString and I can't get it to work. I have tested it by just typing the phrase in the function as NSString and i get the correct response from the server. But when I set it up as it has to be with variables i get a fatal error because it is sending nil. When I try to send it as NSString i get string can't be converted to NSString. How can I do this?
I see lots of solutions for nsstring to string but not the other way around. Or am i doing something else wrong.