您好,我在使用多个 if 语句时遇到问题。这是我的代码:
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];
}
仅考虑第二个 if 语句。第一个 if 语句似乎完全被忽略了。