Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Entering textfield values into an URL

So I'm in the progress of developing an app but I'm kinda stuck at the moment. I have 2 textfields right now that the user will have to enter:

Ordernr:xxxxxxxx
Referencenr:xxxxxxx

these 2 values have to be added to this link: http://www.artis-web.de/cgi-bin/WebObjects/Artis.woa/wa/detailedTrack?referencenr=xxxxxxxx&ordernr=xxxxxxxxxx

now I want safari to open this link. The ideal situation would be the user entering the 2 textfields values and then pressing a button called "open in safari"

What would be the best way to implement this?

like image 903
Florian Schaal Avatar asked Jan 14 '23 17:01

Florian Schaal


1 Answers

Just add the following code to your button action:

NSString *urlString = [NSString stringWithFormat:@"http://www.artis-web.de/cgi-bin/WebObjects/Artis.woa/wa/detailedTrack?referencenr=%@&ordernr=%@", referenceNrTextField.text, orderNrTextField.text];
[[UIApplication sharedApplication] openURL: [NSURL URLWithString: urlString]];
like image 148
Roland Keesom Avatar answered Jan 22 '23 00:01

Roland Keesom