From 0badbf57aeb180f19510d0eb5ebc6c614cb86603 Mon Sep 17 00:00:00 2001 From: "smparkes@smparkes.net" Date: Sat, 6 Apr 2013 22:01:04 +0000 Subject: [PATCH] correctly seperate args in url git-svn-id: https://zxing.googlecode.com/svn/trunk@2629 59b500cc-1b3d-0410-9834-0bbf25fbcc57 --- iphone/Barcodes/Classes/BarcodesAppDelegate.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iphone/Barcodes/Classes/BarcodesAppDelegate.m b/iphone/Barcodes/Classes/BarcodesAppDelegate.m index 7f5ef0788..6b25ec19f 100644 --- a/iphone/Barcodes/Classes/BarcodesAppDelegate.m +++ b/iphone/Barcodes/Classes/BarcodesAppDelegate.m @@ -30,13 +30,14 @@ if (!url) return NO; if ([[url scheme] isEqualToString:@"zxing"]) { if ([[url host] isEqualToString:@"scan"]) { - NSArray *pairs = [[url query] componentsSeparatedByString:@"&"]; + NSArray *pairs = [[url query] componentsSeparatedByString:@"&"]; for (NSString *pair in pairs) { NSArray *elements = [pair componentsSeparatedByString:@"="]; NSString *key = [[elements objectAtIndex:0] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; NSString *val = [[elements objectAtIndex:1] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; - + // NSLog(@"%@ => %@\n", key, val); + if ([key isEqualToString:@"ret"]) { [[NSUserDefaults standardUserDefaults] setObject:val forKey:@"returnURL"]; [[NSUserDefaults standardUserDefaults] synchronize];