Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NKDUPCEBarcodes crashes on 11 character string #6

Open
GoogleCodeExporter opened this issue Sep 1, 2015 · 0 comments
Open

NKDUPCEBarcodes crashes on 11 character string #6

GoogleCodeExporter opened this issue Sep 1, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Pass an 11 character content string to NKDUPCEBarcode initWithContent: 
(NSString *)inContent
       printsCaption: (BOOL)inPrints

What is the expected output? What do you see instead?

It crashes.

What version of the product are you using? On what operating system?

using netshade's fork for iPhone on github

Please provide any additional information below.

The problem is that it tries to convert from UPCA to UPCE using the UPCAToUPCE 
method. Problem is that it is a class method not an instance method so it needs 
to be called on the class not the instance.

The fix is to change this code in NKDUPCEBarcode.m
    if([[self content] length] == 11)
        [self setContent:[self UPCAToUPCE:[NSString stringWithFormat:@"%@%c", [self content], [self checkDigit]]]];

to this:

    if([[self content] length] == 11)
        [self setContent:[NKDUPCEBarcode UPCAToUPCE:[NSString stringWithFormat:@"%@%c", [self content], [self checkDigit]]]];



Original issue reported on code.google.com by dalewk...@gmail.com on 9 Feb 2011 at 6:49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant