-3

Am having problems with what looks like a very simple IF statement, here is the code:

NSString * lowerCaseSubject = [_subjectParameter lowercaseString];
    NSString * subjectPriceString = nil;

if (_subjectParameter) {
        for (int p=0; p < arr.count; p++) {
            subjectPriceString = [arr[p] valueForKeyPath: @"name"];
            if (subjectPriceString == lowerCaseSubject) {
                float price = [[arr[p] valueForKeyPath: @"pricePerHour"]floatValue];
                priceLabel.text = [NSString stringWithFormat:@"%.0f", price];
            }
        }

    }else{

I'm debugging and find that the IF statement below is never set true and so the statements following it never executed:

if (subjectPriceString == lowerCaseSubject) {

This, despite the following field value showing:

enter image description here

Have been trying to fix for ages and getting no where, can anyone see what I am missing here? Thanks

Kitcc
  • 2,138
  • 4
  • 24
  • 42

1 Answers1

5
if ([subjectPriceString isEqualToString:lowerCaseSubject]){
     // do stuff
}
Bamsworld
  • 5,670
  • 2
  • 32
  • 37