mirror of
https://github.com/zxing/zxing.git
synced 2025-01-12 19:57:27 -08:00
stringByReplacingOccurrencesOfString doesn't do what I thought it did
git-svn-id: https://zxing.googlecode.com/svn/trunk@2630 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
0badbf57ae
commit
add451d5bf
|
@ -116,7 +116,20 @@
|
|||
[[NSUserDefaults standardUserDefaults] setObject:resultString forKey:@"lastScan"];
|
||||
NSString *returnUrl = [[NSUserDefaults standardUserDefaults] stringForKey:@"returnURL"];
|
||||
if (returnUrl != nil) {
|
||||
NSURL *ourURL = [NSURL URLWithString:[returnUrl stringByReplacingOccurrencesOfString:@"{CODE}" withString:resultString]];
|
||||
resultString = (NSString*)
|
||||
CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,
|
||||
(CFStringRef)resultString,
|
||||
NULL,
|
||||
(CFStringRef)@"!*'();:@&=+$,/?%#[]",
|
||||
kCFStringEncodingUTF8);
|
||||
|
||||
NSURL *ourURL =
|
||||
[NSURL URLWithString:[returnUrl stringByReplacingOccurrencesOfString:@"{CODE}" withString:resultString]];
|
||||
|
||||
CFRelease(resultString);
|
||||
|
||||
// NSLog(@"%@", ourURL);
|
||||
|
||||
[[UIApplication sharedApplication] openURL:ourURL];
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue