I have a small app, where user can make some calculations and solve equations. For example, if in a square equation discriminant is less than zero, the x1 and x2 values are "nan", so when I assign x1 and x2 values to UILabels they show "nan" as well. Writing a lot of if's like
if(D<0) [label setText:[NSString stringWithFormat: @"No solutions"]];
Doesn't help-there are too many cases. I want to check if after
[label setText:[NSString stringWithFormat: @"%f", x]];
label's value is "nan", the label's value will be set to @"No solutions".
Doing simple
if(label==@"nan") {
//code
}
doesn't help.
Thanks in advance!