I am working on some simple form validation and need some assistance. Basically, I just need to make sure a UITextField doesn’t have a ‘0’ or no value whatsoever (nil) when a user runs a simple calculation. If the field does contain either/or a label will be changed to notify the user. Here is my statement:
if ([abc.text isEqualToString:@"0"] || [time.text isEqualToString:nil]) {
self.123.text = @"Please enter a time";
} else { whatever }
Currently the 123 label is outputting NaN if nothing is entered into the abc UITextField.
1 Answer