2012-01-18 12 views
1

自分のiPhoneアプリケーションでバーコードを自動生成できるプロジェクトを行っています。 私はこれを見つけたhttps://github.com/netshade/Cocoa-Touch-Barcodes私は私に大きな助けになると思います。"1100000001"のような数字に基づいてバーコードを生成

しかし、私はそれを使用しても何も起こりませんでした。 これは私が行った手順です:

1)自分のiphoneアプリケーションを開き、すべての.hと.mファイルをインポートします。 2)は後に、私は、これは自動バーコードを生成し表示XIB)

#import "UIImage-NKDBarcode.h" 
#import "NKDCode39Barcode.h" 
-(void)showBarcode { 
NKDBarcode * nkdbarcode = [[NKDCode39Barcode alloc] initWithContent:@"1234567890123"]; 
UIImage * image = [UIImage imageFromBarcode:nkdbarcode]; 
// assume barcodeIV is an outlet to an imageview 
[barcodeIV setImage:image]; 
} 

である。しかし、それは動作しませんでした(私のbarcode.mにこれを入力します。何かが間に合わなかったのですか? 本当に誰も私を助けることができるように願っています:)

ありがとう&よろしく!

答えて

0

私は同じライブラリを問題なく使用しました。 手順私が行っていることである

1.dowload https://github.com/netshade/Cocoa-Touch-Barcodes 
2.add the complete file named "netshade-Cocoa-Touch-Barcodes-d0aabd0" to the project folder. 
3.Import like #import "BarcodeManager.h" in your viewControllers .h file 
4.Add the following code where yo want to generate bar code with an input given 

コード:私はこれはあなたに男を助けることを願っています

UIImage *barcodeImg=[BarcodeManager 
    generateBarcodeImageWithContent:@"123" type:Code39 size:CGSizeMake(0, 
    0)]; 
      imgView.image=barcodeImg; 

.. :)

+1

私はBarcodeManager.hが表示されませんプロジェクト。どこでそれを手に入れたのですか? – Danny

関連する問題