2012-01-18 1 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

관련 문제