[iphone] added known issues in README when including ZXingWidget into your project...
[zxing.git] / iphone / ScanTest / Classes / RootViewController.m
index cec4693..20ef834 100644 (file)
@@ -7,11 +7,16 @@
 //
 
 #import "RootViewController.h"
+@interface RootViewController()
+@property (nonatomic,retain) ZXingWidgetController *scanController;
+
+@end
 
 
 @implementation RootViewController
 @synthesize resultsView;
 @synthesize resultsToDisplay;
+@synthesize scanController;
 #pragma mark -
 #pragma mark View lifecycle
 
     [super viewDidLoad];
        [self setTitle:@"ZXing"];
   
-       scanController = [[ZXingWidgetController alloc] initWithDelegate:self];
-       [scanController setOneDMode:NO];
-       [scanController setShowCancel:YES];
-       scanController = [scanController initWithDelegate:self];
+  ZXingWidgetController *widController = [[ZXingWidgetController alloc] initWithDelegate:self showCancel:YES OneDMode:NO];
+       self.scanController = widController;
+  [widController release];
        NSBundle *mainBundle = [NSBundle mainBundle];
        [scanController setSoundToPlay:[[NSURL fileURLWithPath:[mainBundle pathForResource:@"beep-beep" ofType:@"aiff"] isDirectory:NO] retain]];
    
@@ -31,7 +35,7 @@
 - (IBAction)scanPressed:(id)sender {
   //UIImagePickerController *picker = [[UIImagePickerController alloc] init];
        [self presentModalViewController:scanController
-                          animated:YES];
+                          animated:NO];
 //     [self.navigationController pushViewController:scanController animated:true];
 }
 
@@ -78,7 +82,6 @@
     [resultsView setText:resultsToDisplay];
     [resultsView setNeedsDisplay];
   }
-  
 }
 
 - (void)cancelled {