[iPhone] updated README to XCode4 way of importing projects

git-svn-id: https://zxing.googlecode.com/svn/trunk@1729 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
rpechayr 2011-03-26 08:45:50 +00:00
parent c1dac34398
commit a8d169d789

View file

@ -1,43 +1,53 @@
ZXing for iOS is a sub-project of zxing project partially maintained by
independent developers. As of 2nd of June 2010, it contains 3 iOS projects:
- BarCodes: Original zxing iOS app. Available on app store. However, the code is currently not maintained and does not build
independent developers. As of 26th of MArch 2011, it contains 3 iOS projects:
- BarCodes: Zxing iOS app. Available on app store.
- ZXingWidget: a Library that can be included in any iOS app
- ScanTest: a simple test app for ZXingWidget
- ScanTest: a simple demo app for ZXingWidget
How to include ZXingWidget in a easy and clean way:
How to include ZXingWidget in a easy and clean way (in XCode4):
====================================================
1. Locate the "ZXingWidget.xcodeproj" file under "`zxing/iphone/ZXingWidget/`". Drag ZXingWidget.xcodeproj and
drop it onto the root of your Xcode project's "Groups and Files" sidebar. A dialog will
appear -- make sure "Copy items" is unchecked and "Reference Type" is "Relative to Project"
before clicking "Add".
before clicking "Add". Alternatively you can right-click on you project navigator and select 'Add files to "MyProject"'
2. Now you need to link the ZXingWidget static library to your project. Click the "ZXingWidget.xcodeproj"
item that has just been added to the sidebar. Under the "Details" table, you will see a single
item: ZXingWidget.a. Check the checkbox on the far right of ZXingWidget.a.
2. Now you need to link the ZXingWidget static library to your project. To do that,
a. select you project file in the project navigator
b. In the second column, select your _target_ and not the project itself
c. Go to the 'build phases' tab, expand the 'link binary with libraries' section,
d. Click the add button A dialog will appear and you should see libZXingWidget.a in the very first possibilities
3. Now you need to add ZXingWidget as a dependency of your project, so Xcode compiles it whenever
you compile your project. Expand the "Targets" section of the sidebar and double-click your
application's target. Under the "General" tab you will see a "Direct Dependencies" section.
Click the "+" button, select "ZXingWidget", and click "Add Target"
you compile your project.
a. like in substep c. of previous step, you nedd to do that in the 'build phases' tab of your target
b. Expand the 'Target Dependencies' section
c. Click the add Button and a dialog will appear select ZXingWidget target
4. Headers search path 1: you need to tell your project where to find the ZXingWidget headers. Open your
"Project Settings" and go to the "Build" tab. Look for "Header Search Paths" and double-click
4. Headers search path 1: you need to tell your project where to find the ZXingWidget headers. Select your project in the
project navigator, and the select your target and go to the "Build Settings" tab. Look for "Header Search Paths" and double-click
it. Add the relative path from your project's directory to the
"zxing/iphone/ZXingWidget/Classes" directory. Make sure you click the checkbox "recursive path" !
5. Headers search path 2: You need to add zxing cpp headers to your headers search path, do this similarly as previous step to point the path to cpp/core/src/ where the 'zxing' directory is. You don't need to make this search path recursive so do not check the "recursive path" option
6. Import the following iOS frameworks: AVFoundation, AudioToolbox, CoreVideo, CoreMedia and libiconv
6. Import the following iOS frameworks:
a. AVFoundation
b. AudioToolbox
c. CoreVideo
d. CoreMedia
e. libiconv
This must be done by adding them in the 'Link Libraries with Binary' just like step 2.c.
7. You're almost ready to go ..
8. #import <ZXingWidgetController.h> from a file
8. #import <ZXingWidgetController.h> in a source file
9. #import <QRCodeReader.h> for example because you will need to inject a barcode reader into ZXingWidgetController.
10. MAKE SURE the file in which you are using the code deader is a .mm because you are now silently including some c++ code. If you don't do so then
the compiler will cry as if it does not find some files !
the compiler may cry as if it does not find some files !
11. It should work :)