1

Okay, I got through the initial bumps of setting everything up correctly, and I have a great tabbed application that does almost everything I need:

I have two tabs, a Scan and a Tickets tab. The Tickets tab presents a web view that allows users to select a ticket. Once they have selected a ticket, they can start scanning. The scanner reads a barcode, this barcode is successfully decoded and stored as a property called scanResults. What I would like to happen from this point is to send a new URL to my web view that is a direct copy of the current URL, but with the scanned number added as a php parameter. The problem is, whenever I try this my web view freezes. It seems I can't manipulate my web view from outside of the tab that controls it. Ideally, I'd like to simply have a url format that changes each time a barcode is scanned, like:

"www.mywebsite.com?scannedNumbers=" (scanned number here)

Can anyone suggest what I do from here? If I need to post code I can, I know my scanner works, and I know my web view will work if I load the site without using the scanner first, so the individual elements work fine.

Red Fish
  • 13
  • 4

1 Answers1

0

there is an easy way to connect your url with the scanned number.

First of all you need to save the url as a string and your scanned number too. Now you can use this code to combine them...

NSString * combinedUrl = [stringURL stringByAppendingString:stringScannedNumber];

Now you can simply convert the NSString into a NSURL and paste it into your web view (i never used a web view so i dont really know ho to get rid of the webview problem.)

(You can also use the shared application methode to open the url in safari but this needs to be put in an IBAction...

[[UIApplication sharedApplication] openURL:[NSURL URLWithString: combinedUrl]];

)

I hope i could help you :)

  • Thank you for the advice, unfortunately I am certain my string concatenation is working. I can print the string to a label. My problem is that, when I try to feed this string into a web view, the web view freezes. – Red Fish Oct 03 '12 at 15:22