ios - how do I concatinate strings to create a url?
- by GeekedOut
I am trying to make a url by first collecting the parameters, and then in one statement creating the actual url. Here is what I am trying to do:
NSString *urlString = @"http://www.some_login_url.com?email=%@&password=%@";
NSString *email = self.email.text;
NSString *password = self.password.text;
NSString *url_to_send = [NSString stringWithFormat:@"%@%@", urlString , email , password];
So what I wanted to do was replace the @ symbols with the values in the variables, but instead the second variable just got appended to the end of the string.
How would I change the last line so I could put the right parameters in their correct spots?
Thanks!!