Simple objective-c QR Code reader

1,655 views
Skip to first unread message

Lordjozz

unread,
Apr 26, 2012, 9:51:03 AM4/26/12
to zxing

I am looking to create a simple objective c program using zxing, which
scans a capture session for qr codes
and returns the string of text that the qr code contains.

Being new to objective c and zxing I am stumbling around a little
whilst trying to establish exactly the lines of code I
need.

I have successfully integrated the zxing library into my project and I
have set up my own capture session using objective-C
and Cocoa.

If anyone could help me out with the specific lines of code I need to
set up the QRCodeReader and scan for codes then it would
be greatly greatly appreciated.

Thanks

Steven Parkes

unread,
Apr 26, 2012, 10:39:45 AM4/26/12
to Lordjozz, zxing
Not a lot of detail here, e.g., osx/cocoa or ios/cocoa touch?

For iOS, the canonical example is ScanTest: http://code.google.com/p/zxing/source/browse/trunk/iphone/ScanTest/README

For OS X, there really is no canonical example. At best, https://github.com/smparkes/zxing-objc-demo-app and https://github.com/smparkes/zxing.app but they both have their drawbacks.

Lordjozz

unread,
Apr 26, 2012, 11:13:49 AM4/26/12
to zxing
It's osx/cocoa.

Is there no way of just setting up the program so that a
CaptureSession is used as an input and it is observed
for QR Codes?

Steven Parkes

unread,
Apr 26, 2012, 11:20:39 AM4/26/12
to Lordjozz, zxing
The two cited projects will decode from either isight or external cameras (from what I hear) so the core is there but the packaging is incomplete/inelegant. Needs some love …

If you're setting up the QT capture stuff with your own code, it shouldn't be hard to pass the captured frames to the decoder but the only docs are the code/examples.

Lordjozz

unread,
Apr 26, 2012, 11:24:27 AM4/26/12
to zxing

Ok, thanks a lot, I shall look into those two projects and see what I
can salvage with some tlc.

I'll also have a look at the decoder.

Thanks for the quick response. I may be back... :)

TequilaKez

unread,
Apr 26, 2012, 12:57:59 PM4/26/12
to zxing
Pretty keen to get this going too but I'm not getting too far. Can't
build https://github.com/smparkes/zxing-objc-demo-app due to packing.
Has anyone had any luck? I'm fairly new to xcode
and I don't why its complaining about files. Its looking for headers
but they are in the 'User header search path' and its set to yes but
yet Xcode still complains. Anyone got any tips?

Steven Parkes

unread,
Apr 26, 2012, 1:33:36 PM4/26/12
to TequilaKez, zxing
I just posted a copy of what notarysojac put together. He made some choices that didn't seem to fit too well with the existing projects and the conflicts were never resolved.

This project probably needs to be reworked by somebody that understands app/framework packaging well (which unfortunately isn't me.)

Maybe several people working together can pool their experience and clean things up ...

Lordjozz

unread,
Apr 26, 2012, 9:03:33 PM4/26/12
to zxing
I've managed to get the zxing-objc-demo-app working by painstakingly
importing all the files and editing the pathnames, however I've not
yet got the result section of the app to work, it recognises that it
has seen a qrcode but something seems to be going wrong between the
decoding and the result output, I'm going to continue looking into
this as I need to get It working, so i'll keep posting on this thread
how I do if it would be helpful to you TequilaKez?

Steven Parkes

unread,
Apr 26, 2012, 9:12:39 PM4/26/12
to Lordjozz, zxing
I can also give you commit rights on github if you think your fixes would be generally applicable.

Or you can fork it and keep your own repo.

I only put it up there (with permission) because notarysojac removed his copy. I've never even tried to build it so it would make sense for someone who's more actively trying to use it to own it.

TequilaKez

unread,
May 3, 2012, 9:29:02 PM5/3/12
to zxing
Yes definitely would help. Perhaps even if you send me a project of
where you're at and I can have a look also to see where it is going
wrong.

Cheers,

Kez.

TequilaKez

unread,
May 19, 2012, 8:36:02 PM5/19/12
to zxing
Anyone get any further with this?

On Apr 27, 12:39 am, Steven Parkes <smpar...@smparkes.net> wrote:
> Not a lot of detail here, e.g., osx/cocoa or ios/cocoa touch?
>
> For iOS, the canonical example is ScanTest:http://code.google.com/p/zxing/source/browse/trunk/iphone/ScanTest/RE...
>
> For OS X, there really is no canonical example. At best,https://github.com/smparkes/zxing-objc-demo-appandhttps://github.com/smparkes/zxing.appbut they both have their drawbacks.
>
> On Apr 26, 2012, at 6:51 AM, Lordjozz wrote:
>
>
>
>
>
>
>
>
>
> > I am looking to create a simpleobjective cprogram using zxing, which
> > scans a capture session for qr codes
> > and returns the string of text that the qr code contains.
>
> > Being new toobjective cand zxing I am stumbling around a little
Reply all
Reply to author
Forward
0 new messages