Monday, 26 August 2013

I have 2 if statements in one, the first is being skipped, why?

I have 2 if statements in one, the first is being skipped, why?

Hi there I'm having trouble using multiple if statements. Here is my code:
if ([itemOnSpecial caseInsensitiveCompare: @"yes"] == NSOrderedSame) {
UILabel *specialLabel = (UILabel*) [cell viewWithTag:5];
specialLabel.text = specialPrice;
[specialLabel setHidden:NO];
}
//This statement is completely skipped
if ([isOnBulkSpecial caseInsensitiveCompare:@"yes"] == NSOrderedSame) {
UILabel *specialLabel = (UILabel*) [cell viewWithTag:5];
specialLabel.text = bulkSpecialPrice;
[specialLabel setHidden:NO];
}else{
UILabel *specialLabel = (UILabel*) [cell viewWithTag:5];
[specialLabel setHidden:YES];
}
Only the second if statement is taken into account. The first if statement
seems to be completely disregarded.

No comments:

Post a Comment