Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have managed to integrate ZXING into my test project. I have done this a little time ago so I might not remember all the problems that I faced and solved. Into my workspace folder I have copied ZXing-2.0 folder. Inside I have only left folders: cpp, docs and iphone. To my workspace (containing the test project) I have added ZXingWidget project from the folder ZXing-2.0. This allowed me to add to linking setting libZXingWidget.a. When I build my test project, XCode detects dependency and builds the widget first and then builds the test project and links it against libZXingWidget.a.</p> <p>Here's a simple view controller that I have implemented to display inside camera view able to detect QR code.</p> <pre><code>// // MyVC.m // // #import "MyVC.h" #import "QRCodeReader.h" @interface MyVC () { ZXingWidgetController *_widController; } @end @implementation MyVC @synthesize labelResultString; - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view from its nib. _widController = [[ZXingWidgetController alloc] initWithDelegate:(id&lt;ZXingDelegate&gt;)self showCancel:YES OneDMode:NO]; QRCodeReader* qrcodeReader = [[QRCodeReader alloc] init]; NSSet *readers = [[NSSet alloc ] initWithObjects:qrcodeReader,nil]; //[qrcodeReader release]; _widController.readers = readers; //[readers release]; //NSBundle *mainBundle = [NSBundle mainBundle]; //_widController.soundToPlay = [NSURL fileURLWithPath:[mainBundle pathForResource:@"beep-beep" ofType:@"aiff"] isDirectory:NO]; _widController.overlayView.displayedMessage = @""; _widController.wantsFullScreenLayout = NO; //[self presentModalViewController:_widController animated:NO]; _widController.view.frame = CGRectMake(10, 10, 300, 300);//self.view.frame; _widController.view.autoresizingMask = UIViewAutoresizingNone; _widController.overlayView.frame = CGRectMake(0, 0, 300, 300); _widController.overlayView.cropRect = CGRectMake(20, 20, 260, 260); [self.view addSubview:_widController.view]; //[_widController release]; } - (void)viewDidUnload { [super viewDidUnload]; self.labelResultString = nil; } - (void)dealloc { self.labelResultString = nil; } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [_widController viewWillAppear:animated]; } - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; [_widController viewDidAppear:animated]; [[UIApplication sharedApplication] setStatusBarHidden:NO]; } - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; [_widController viewWillDisappear:animated]; } - (void)viewDidDisappear:(BOOL)animated { [super viewDidDisappear:animated]; [_widController viewDidDisappear:animated]; } #pragma mark - ZXingDelegateMethods - (void)zxingController:(ZXingWidgetController*)controller didScanResult:(NSString *)result { self.labelResultString.text = result; } - (void)zxingControllerDidCancel:(ZXingWidgetController *)controller { [self dismissModalViewControllerAnimated:YES]; } @end </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload