user6631314
user6631314

Reputation: 1966

IOS/Objective-C: Conflicting return type in implementation error

Can anyone suggest why following is giving warning of Conflicting return type in implementation error myStatus level void vs. int, what this means, and how to fix it?

Thanks in advance for any suggestions.

-(int) myStatusLevel: (int)numpoints {
    //calculates status from points and saves in default.
    int status;
    if (numpoints>=20&&numpoints<=99) {
        status = 1;
    }
    else if (numpoints>=100&&numpoints<=499) {
        status = 2;
    }
    else if (numpoints>=500&&numpoints<=999) {
        status = 3;
    }
    else if (numpoints>=1000&&numpoints<=1999) {
        status = 4;
    }
    else if (numpoints>=2000) {
        status = 5;
    }
    else {
        status = 0;
    }

    return status;
}

Upvotes: 2

Views: 1077

Answers (1)

Rob
Rob

Reputation: 437882

You have likely defined myStatusLevel in your @interface with void, rather than the method signature you've shared with us here.

Upvotes: 3

Related Questions