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.
Since iOS SDK version is updating on frequent basis, we deliver the IPhone barcode generator SDK as source code. You can build the
source code into library using the proper development environment, i.e.
iOS7,
iOS8.
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"