Lion
Lion

Reputation: 872

How to implement zxing in os x application to get or read the qr code data?

I am looking to implement a class that will be able to read a QR Code from a file (jpeg, bmp, whatever) or from camera (both internal and external) and output that information as an NSString.

I've attempted to use the Objective-C OSX project included with ZXing, but I have been unable to get it to play nice with my own projects.

Has anybody had any success in doing this? or suggest me with other options to read the qr code like any web services etc. Please help me to overcome this problem. Thanks in advance!

Upvotes: 0

Views: 1080

Answers (2)

Francisco Gutiérrez
Francisco Gutiérrez

Reputation: 1393

Use ZBar instead it's easier to install and has more low level capabilities so with this you can customize your app like you want.

Upvotes: 0

John
John

Reputation: 116

ZXing comes with a sample project showing how it works in IOS. Its a good example so us it.

I used the ZXing project in a project of my own, and it works great. Took a few google searches to remove all the compile errors, but its all out there.

  1. create a ZXingWidgetController object and give it a delegate.
  2. the delegate should implement

    - (void)zxingController:(ZXingWidgetController*)controller didScanResult:(NSString *)result

    - (void)zxingControllerDidCancel:(ZXingWidgetController*)controller

  3. present the ZXing Controller. When cancelled or scan, the ZXing delegate methods will be called. Make sure you dismiss the zxingController in both delegate methods.

  4. in the zxingController:didScaneResult: the result will have the string that you would be interested.

Upvotes: 2

Related Questions