DOC

use Zbar SDK sample

By Annie Greene,2014-09-09 14:54
13 views 0
use Zbar SDK sample

    use Zbar SDK sample

    1、参考前面Zbar SDK iOS使用ZbarSDK实现扫描二维码以及条形码功能 的帖子将那下载SDK拖入到项目中。

2、加入Library如下!

3、到Build Settings刪除那 armv7s,留下armv7,如下!

4、新建你的viewController.h文件如下?未使用xib?!

    1. #import <UIKit/UIKit.h>

    2. #import "ZBarSDK.h"

    3.

    4. @interface QRCodeViewController :

    UIViewController<ZBarReaderViewDelegate> {

    5.

    6. ZBarReaderView *readerView;

    7. ZBarCameraSimulator *cameraSim;

8.

    9. }

    10.

    11. @end

    12.

    复制代码

    5.m文件如下!

    普通浏览复制代码保存代码打印代码

    1. #import "QRCodeViewController.h" 2.

    3. @interface QRCodeViewController () 4.

    5. @end

    6.

    7. @implementation QRCodeViewController 8.

    9.

    - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)ni

    bBundleOrNil

    10. {

    11. self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNi

    l];

    12. if (self) {

    13. [self setTitle:@"QRCode"]; 14. [self.tabBarItem setTitle:@"QRCode"]; 15. }