QR Code encoding / generation on an iOS Device

In one of my recent projects, the need to encode QR codes on the device came up. I tried a few different methods and wasn’t really satisfied with any of them.
The method detailed here is the one I chose based on ease of use and the quick set up time.
The core library is written in c and the base version can be found here: http://fukuchi.org/works/qrencode/index.html.en (download the entire project below).

I am using a modified version with a few helper methods written in objective-c. Then my usage is as follows:


UIImage *image = [self quickResponseImageForString:@"http://danielbeard.wordpress.com" 
                                     withDimension:182];

//set the image
[imageView setImage: image];

And the result:
Image

Here is the full project with an example: Download Project

About these ads

7 thoughts on “QR Code encoding / generation on an iOS Device

  1. GOOD JOB! And thank you SO much for sharing this. I’ve been trying to use this in an iOS project forever but as soon as I add the files and import the headers in my XCode project I get a million compiler errors that I have no Idea how to solve. I’ve downloaded you project and it all works as promised. How exactly did you configure Xcode to not freak out with this lib?

  2. Thanks for sharing :)

    how would you go around it if you would do it n cocoa mac osx ? am trying to get text from field and based on that you click a button to preview the text you wrote in qr code in an NSImageView

  3. Pingback: QR Code encoding / generation on an iOS Device | QR Code Fun

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s