QRCode encoding a simple string in ios

大兔子大兔子 提交于 2019-12-07 17:13:38

问题


I have downloaded a sample code from github for QRCode encoding.

It works fine and generates an image with QRCode for string that I specified.

But, when I scan that image, it displays the string like http://mystring.

I need only mystring. How to do that? Is the problem is with QRscanner app?

I think the QRencoderapp is about encoding an url.

Is there any other sample to encode just a simple string (not url)?

or

Is there any changes to be done get the string instead of url in the above code?


回答1:


I 've solved my problem.

I downloaded a project from this Github link.

The code in that prjct creates a QRCode image for a simple text.

NSString *code = @"Our String to be encoded";

Barcode *barcode = [[Barcode alloc] init];

self.view.backgroundColor = [UIColor whiteColor];

[barcode setupQRCode:code];

ourImageView.image = barcode.qRBarcode;

Hope, this will help others.



来源:https://stackoverflow.com/questions/15570678/qrcode-encoding-a-simple-string-in-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!