From: dkavanagh Date: Thu, 13 May 2010 14:10:18 +0000 (+0000) Subject: tweaks to get the decode working X-Git-Url: http://git.rot13.org/?p=zxing.git;a=commitdiff_plain;h=9ef7c3eec59fd392aed6f79b7e905fefad0f3b2f tweaks to get the decode working git-svn-id: http://zxing.googlecode.com/svn/trunk@1358 59b500cc-1b3d-0410-9834-0bbf25fbcc57 --- diff --git a/iphone/ZXingWidget/MultiFormatReader.mm b/iphone/ZXingWidget/MultiFormatReader.mm index 7f38ab27..3517e37b 100644 --- a/iphone/ZXingWidget/MultiFormatReader.mm +++ b/iphone/ZXingWidget/MultiFormatReader.mm @@ -35,7 +35,6 @@ - (id)init { zxing::MultiFormatReader *reader = new zxing::MultiFormatReader(); - NSLog(@"MultiFormatReader: init called"); return [super initWithReader:reader]; } diff --git a/iphone/ZXingWidget/ZXingWidget.xcodeproj/project.pbxproj b/iphone/ZXingWidget/ZXingWidget.xcodeproj/project.pbxproj index 8ac1aa4d..3eafbc08 100644 --- a/iphone/ZXingWidget/ZXingWidget.xcodeproj/project.pbxproj +++ b/iphone/ZXingWidget/ZXingWidget.xcodeproj/project.pbxproj @@ -1092,8 +1092,9 @@ ALWAYS_SEARCH_USER_PATHS = YES; ARCHS = "$(ARCHS_STANDARD_32_BIT)"; COPY_PHASE_STRIP = NO; - DEAD_CODE_STRIPPING = NO; + DEAD_CODE_STRIPPING = YES; DSTROOT = /tmp/ZXingWidget.dst; + EXPORTED_SYMBOLS_FILE = exportList; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; GCC_MODEL_TUNING = G5; @@ -1104,10 +1105,13 @@ INSTALL_PATH = /usr/local/lib; IPHONEOS_DEPLOYMENT_TARGET = 3.1.2; LD_GENERATE_MAP_FILE = YES; - LD_OPENMP_FLAGS = "-fopenmp -M"; + LD_OPENMP_FLAGS = "-fopenmp"; MACH_O_TYPE = staticlib; - OTHER_LDFLAGS = "-ObjC"; - PRESERVE_DEAD_CODE_INITS_AND_TERMS = YES; + OTHER_LDFLAGS = ( + "-ObjC", + "-M", + ); + PRESERVE_DEAD_CODE_INITS_AND_TERMS = NO; PRODUCT_NAME = ZXingWidget; SDKROOT = iphoneos3.1.3; SEPARATE_STRIP = NO; diff --git a/iphone/ZXingWidget/ZXingWidgetController.m b/iphone/ZXingWidget/ZXingWidgetController.m index 6560d9a6..754c6e7b 100755 --- a/iphone/ZXingWidget/ZXingWidgetController.m +++ b/iphone/ZXingWidget/ZXingWidgetController.m @@ -81,6 +81,7 @@ CGImageRef UIGetScreenImage(); - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; + [overlayView setPoints:nil]; wasCancelled = false; [NSTimer scheduledTimerWithTimeInterval: FIRST_TAKE_DELAY target: self @@ -138,16 +139,16 @@ CGImageRef UIGetScreenImage(); // [self presentResultForString:twoDResult.text]; NSLog(@"decoded image!!"); [self presentResultPoints:[twoDResult points] forImage:image usingSubset:subset]; - if (delegate != nil) { - [delegate scanResult:[twoDResult text]]; - } + // now, in a selector, call the delegate to give this overlay time to show the points + [self performSelectorOnMainThread:@selector(alertDelegate:) withObject:[[twoDResult text] copy] waitUntilDone:false]; decoder.delegate = nil; [decoder release]; - - // save the scan to the shared database - // [[Database sharedDatabase] addScanWithText:twoDResult.text]; - // need to call delegate....` - // [self performResultAction:self]; +} + +- (void)alertDelegate:(id)text { + if (delegate != nil) { + [delegate scanResult:text]; + } } - (void)decoder:(Decoder *)decoder failedToDecodeImage:(UIImage *)image usingSubset:(UIImage *)subset reason:(NSString *)reason { diff --git a/iphone/ZXingWidget/exportList b/iphone/ZXingWidget/exportList new file mode 100644 index 00000000..56007099 --- /dev/null +++ b/iphone/ZXingWidget/exportList @@ -0,0 +1 @@ +.objc_class_name_MultiFormatReader