0

I want to test my barcode scanner using iPhone Camera.

I'm using ZBar SDK for my barcode scanning.

I have a scan button for this.When I click on Scan button,its showing me the message,"Camera simulation, tap and hold with two finger to select image".When I'm doing this,its showing "No photo" in another view.

I'm doing like this:

-(IBAction) scanButtonTapped
{
//Barcode reader that scans from camara feed
reader = [ZBarReaderViewController new];
reader.readerDelegate = self;
reader.supportedOrientationsMask = ZBarOrientationMaskAll;
ZBarImageScanner *scanner = reader.scanner;
//disable rarely used I2/5 to improve performance
[scanner setSymbology:ZBAR_QRCODE config:ZBAR_CFG_ENABLE to:0];
reader.readerView.zoom = 1.0;
//present and release the controller
[self presentModalViewController:reader animated:YES];

}
-(void)imagePickerController:(UIImagePickerController *)picker   didFinishPickingMediaWithInfo:(NSDictionary *)info
{
//get decode result
id<NSFastEnumeration> results = [info objectForKey:ZBarReaderControllerResults];
ZBarSymbol *symbol = nil;
for (symbol in results) {
    break;
}
resultText.text = symbol.data;
resultImage.image = [info objectForKey:UIImagePickerControllerOriginalImage];
[reader dismissModalViewControllerAnimated:YES];
}

I'm trying to scan QR code.

Could any one plaese tell me how can I select an barcode image and scan it using simulater?

Thanks.

bapi
  • 1,903
  • 10
  • 34
  • 59
  • Camera isn't available in simulator so it is not possible to scan via simulator but if you want to add any image into simulator just drag the image and drop it on the simulator it will be opened in safari, press and hold the cursor on the image, an actionSheet appears saying save image, copy and cancel, just save the image it will be added to your library. But not in the scanner mode – Talha Dec 27 '12 at 14:54

1 Answers1

0

You can't. Camera is only available on device.

sqreept
  • 5,236
  • 3
  • 21
  • 26
  • Some one had already done it.But, he has not shared the idea.Plaese have a look "zbar sdk not working on iPhone simulator by using camera simulator" on stack overflow. – bapi Dec 27 '12 at 14:51