iPhone Barcode Generator Tutorial

How to generate linear and 2d barcodes in your iPhone (iOS) applications using iPhone Barcode Generator?



iPhone Barcode is a iPhone Barcode Generator SDK component which generates and draws multiple 1D (linear) and 2D (matrix) barcodes in your iPhone and iPad applications.

Our iPhone Barcode Generator supports iOS 6, containing the new process architecture armv7s for iPhone 5.


Index


iPhone Barcode Generator Install

  • To integrate iPhone Barcodes Generator SDK in iPhone simulator, use the library files under folder "Release-iphonesimulator"

  • To integrate iPhone Barcodes Generator SDK in iPhone device, use the library files under folder "Release-iphoneos"



iPhone Barcode Generator demo appliction install and run

To help you easily test our iPhone Barcodes Generator SDK, we include one demo project in the trial package.

  1. Download the evaluation version of iPhone Barcode Generator Library. (download it now)

  2. Under folder "IPhoneBarcodeClient", copy folder "OnBarcodeIPhoneClient" to your Mac computer

  3. Click file "OnBarcodeIPhoneClient.xcodeproj" to open the demo project

  4. In Xcode, go to Menu "Project", and click item "Edit Project Settings"

  5. Set "Base SDK" to your own SDK version, we are using SDK 3.1.2 to develop the demo project

  6. Go to "Targets", right click "OnBarcodeIPhoneClient", select "Get Info"

  7. In "Build" tab, Set "Header Search Paths" to "demo project path/OnBarcodeIPhoneClient/${BUILD_STYLE}-${PLATFORM_NAME}/usr/local/include".

  8. Run the project, in simulator, click the "Create Barcode" button above to view the demo chart



iPhone Barcode Generator demo source code in Objective-C

Sample Objective-C code:
- (void)drawRect:(CGRect)rect {
    // Drawing code
    
    OBLinear *pLinear = [OBLinear new];
    [pLinear setNBarcodeType: OB_CODE128A];
    [pLinear setPDataMsg: [[NSString alloc] initWithString: (@"AB")]];
    //[pLinear setPSupData: [[NSString alloc] initWithString: (@"14562")]];
    [pLinear setFX: USER_DEF_BAR_WIDTH];
    [pLinear setFY: USER_DEF_BAR_HEIGHT];
    
    [pLinear setFLeftMargin: (USER_DEF_LEFT_MARGIN)];
    [pLinear setFRightMargin: (USER_DEF_RIGHT_MARGIN)];
    [pLinear setFTopMargin: (USER_DEF_TOP_MARGIN)];
    [pLinear setFBottomMargin: (USER_DEF_BOTTOM_MARGIN)];
    
    [pLinear setNRotate: (OB_Rotate0)];
    
    UIFont *pTextFont = [UIFont fontWithName: @"Arial" size: 8.0f];
    [pLinear setPTextFont: pTextFont];
    
    [pLinear drawWithView: (self)];
    [pLinear release];
    
}
 

Each barcode type properties settings in iPhone Barcode Generator



iPhone Barcode Generator FAQ

1. iPhone Barcode Generator Library file "libOnBarcodeIPhone.a" file is not of required architecture

  • In iPhone simulator, use the library files under folder "Release-iphonesimulator"

  • In iPhone device, use the library files under folder "Release-iphoneos"





OnBarcode is a market-leading provider of barcode generator, reader controls and components for ASP.NET, Windows Forms, WPF, as well Java, Android, iOS (iPhone, iPad) across all major enterprise development platforms. We provides high quality tutorials and guides for various linear, 2d barcode information, such as C# Barcode, QR Code C#, QR Code VB.NET, QR Code ASP.NET, QR Code .NET, ASP.NET Barcode.
Terms of Use | Privacy Policy
Copyright © OnBarcode.com . All rights reserved.