How to install ZXing in Xcode 4

本文详细介绍了如何在Xcode4中安装ZXing库,包括添加项目依赖、链接静态库及配置头文件搜索路径等步骤,帮助读者顺利完成ZXing的一键安装。

After an upgrading to Xcode 4, I have been having trouble compiling my own ZXing iOS project.
So I decided to explain you how to install easily ZXing with Xcode 4.

First of all (for those who don’t know), ZXing is an open-source library to read the 1D/2D barcodes. This library is available on many platforms such as the iOS, Android, Blackberry, ect. You can find it here: http://code.google.com/p/zxing/.

Before to start, be sure that you have the latest version of ZXing on your computer. If you don’t, you must download it via a SVN client here: http://zxing.googlecode.com/svn/trunk/.

To use ZXing into your project in Xcode 4 follow these steps:

  1. ZXingWidget.xcodeproj
  2. Firstly go to the “zxing/iphone/ZXingWidget/” and drag and drop the ZXingWidget.xcodeproj file onto your Xcode “Project navigator” sidebar. If a dialog appears uncheck the “Copy items” and verify that the “Reference Type” is “Relative to Project” before clicking “Add”.

    XZingWidget Target Dependencies
  3. Now we are going to add ZXingWidget as a dependency of your project to allow Xcode to compile it whenever you compile the main project:
    1. First select your project file in the “Project navigator”.
    2. Then select the corresponding target.
    3. After choose the “Build Phases” tab and expand the “Target Dependencies” section.
    4. Click the “+” (add) button to display a dialog.
    5. To finish add the “ZXingWidget” target as shown above.

    Static ZXing Library
  4. Now we are going to link the ZXingWidget static library (libZXingWidget.a) to the project:
    1. Firstly choose the “Build Phases” tab and expand the “Link Binary With Libraries” section.
    2. Then click the “+” (add) button to display a dialog.
    3. To finish add the “libZXingWidget.a” which is located in the “Workspace” category as shown above.
    4. By the way add the following iOS frameworks too:
      • AddressBook
      • AddressBookUI
      • AudioToolbox
      • AVFoundation
      • CoreMedia
      • CoreVideo
      • libiconv.dylib

    Header Search Path
  5. Then you must configure the header search path of your project to allow Xcode to find the ZXingWidget headers. To do that:
    1. In the “Project navigator” select the main project (not the target).
    2. Go to the “Build Settings” tab and search the “Header Search Paths“.
    3. Double-click on it and add:
      • The full path of the “zxing/iphone/ZXingWidget/Classes” directory. Check the “recursive path“.
      • The full path of the “zxing/cpp/core/src/” directory. Uncheck the “recursive path“.

Now you just have to import the “ZXingWidgetController.h” and the “QRCodeReader.h” to your project and use them.
Attention: Make sure that the files in which you are using the ZXing headers have the .mm extension because they use c++ library files.

Voilà! Now all should be ok. I hope it’ll help you!


转自:http://yannickloriot.com/2011/04/how-to-install-zxing-in-xcode-4/

1)代码生成主要依赖于freeMark模板,不同的项目需求可以通过修改freeMark模板来实现。 2)如果是后台管理系统,则可以生成管理系统基本的网站页面及其功能。其他系统则很难生成前端页面,主要困难在于模板不统一,如果页面风格都相似,也可以用模板生成页面,然后再对页面进行修改。 3)项目基本功能:根据数据库表生成基本功能代码,包含Mybatis文件,dao、servic、entity、controller以及查询页面、增加编辑页面。 4)生成过程中可以选择编辑页面所需要的字段,列表页面所需要的字段以及查询条件所需要的字段。 # 数据库 1)数据库文件在项目根目录下的doc文件夹下xcode.sql文件 2)创建数据库xCode 默认设置root账户、密码root123 3)执行xcode.sql文件的SQL,创建数据表结构即可 # 项目结构 1)项目根目录下的doc文件夹放置的是开发相关的文档 2) pom.xml 文件是maven相关配置文件 3)src.main 包下有三个文件夹,Java文件夹很明显,是Java文件相关。 resources文件夹是 配置相关的文件夹,包括spring相关配置,Mybatis相关配置,数据库相关配置,redis相关配 置都在此文件夹下,webapp文件夹下是页面相关的 4)com.cn.cooxin包,admin包主要是管理代码生成后台功能的文件,包含用户的管理、角色菜单管理,代码生成管理等,code包主要是代码生成相关的功能,common包是公共服务相关的功能,ueditor是百度编辑器相关的功能,如果不用,可以不用管。util包是开发工具类相关的功能。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值