I have a bunch of UITextFields where a user must enter a number (the keyboard is the number pad) before pressing a submit button. When the submit button is pressed, a “check” method is called that wants to check if the data is valid… aka not empty. Now this would be easy if it was just one textField but I have 14. I want a simple if-statement that checks if one of the fields or all of the fields are empty….
I have the follow UITextFields declared: number1, number2, number3 etc etc
and I have the follow strings declared which can take the value of the UITextField.text… they are declared: temp1, temp2, temp3 etc…
how would I go about making a pseudocode if statement like the one below?
Thanks
if (!valid)
{
NSLog (@"not valid)
}
else
{
//proceed to next method
}
I am supposing UITextField variable as *tfield so here is the solution