I want to compare the value of an NSString
to the string "Wrong". Here is my code:
NSString *wrongTxt = [[NSString alloc] initWithFormat:@"Wrong"];
if( [statusString isEqualToString:wrongTxt] ){
doSomething;
}
Do I really have to create an NSString for "Wrong"?
Also, can I compare the value of a UILabel
's text
to a string without assigning the label value to a string?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…